candy
Version:
a micro bbs system based on duoshuo.com apis
1,127 lines (1,040 loc) • 20.4 kB
text/less
/* Main */
#ds-thread{
clear : both;
position: relative;
overflow: visible;
_zoom: 1;
}
#ds-thread #ds-reset{
a {
cursor: pointer;
text-decoration: none;
color: @link-color;
//font-size: 12px; //是否是链接与文字大小无关
background-color: transparent; // for compatible
&:hover {
color: @link-hover-color;
}
.transition(color);
}
ul, ul li{ // for compatible
background:none;
margin: 0;
padding: 0;
}
.ds-arrow {
position: absolute;
width: 0;
height: 0;
/* ie6 height fix */
font-size: 0 ;
line-height: 0 ;
/* ie6 transparent fix */
_border-right-color: pink ;
_border-left-color: pink ;
_filter: chroma(color=pink) !important;
}
.ds-arrow-down {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #fff;
}
button{
cursor: pointer;
margin: 0; // for compatible
padding: 0; // for compatible
border-radius : 0; // for compatible
}
/* Meta */
.ds-meta {
position : relative;
padding: 8px 0;
line-height: 24px;
border-bottom: @border-shadow;
}
.ds-like-tooltip{
position: absolute;
z-index: 9999;
.gradient2(#fcfcfc, #f9f9f9);
border: @border-dark;
box-shadow: 0 0 2px rgba(0,0,0,0.2);
text-shadow: @text-shadow;
font-size:@font-size-small;
padding: 8px 14px;
ul{
width:84px;
float:left;
}
li{
line-height:16px;
margin:6px 0;
}
p{
clear:both;
margin:6px 0;
}
.ds-like-tooltip-footer{
text-align:right;
}
}
a.ds-like-thread-button{
color: @gray;
padding: 4px 8px;
border: @border-gray;
border-bottom-color: #aaa;
box-shadow: inset 0 0 1px #fff;
margin-right:15px;
text-shadow: @text-shadow;
.gradient(#e0e0e0, #ffffff);
.ds-icon-heart {
position: relative;
top: -2px;
opacity: 1;
}
span {
color: @gray;
}
}
.ds-thread-cancel-like{
display:none;
}
a.ds-thread-liked{
background: #e9e9e9;
&:hover{
.ds-thread-cancel-like{ display:inline;}
.ds-thread-like-text{ display:none;}
}
}
/* Hot Posts */
#ds-hot-posts{
border:@border-gray;
overflow:hidden;
margin: 8px 0;
padding:0;
_height:100%; // ie6 peekaboo bug fix
}
.ds-header{
font-weight:bold;
font-size:@font-size-large;
color : @gray;
line-height:30px;
padding : 0 12px;
}
/* Toolbar */
.ds-toolbar {
position: relative;
z-index: 5; // ie6 下拉菜单被盖住的bug fix
font-size: @font-size-small;
padding: 8px 0;
width: 100%;
clear: both;
&:after {
.clearfix();
}
}
.ds-visitor{
float:right;
line-height:1.5em;
margin-right:6px;
}
.ds-account-control {
float:right;
position:relative;
/*position: absolute;
right: 1px;
top: 10px;*/
//z-index: 99;
font-size: @font-size-small;
cursor: pointer;
text-align: right;
line-height: 18px;
padding-bottom: 3px;
width: 75px;
span {
display:block;
float:left;
color: @gray-lighter;
}
ul {
display: none;
position: absolute;
top: 19px;
left: 0px;
border: @border-dark;
background: @gray-background;
box-shadow: inset 0 1px 1px #fff, 0 1px 1px rgba(0,0,0,.3);
border-radius: @border-radius;
text-align: center;
li {
a {
border-top: 1px solid #fff;
border-bottom: 1px solid #ddd;
display: block;
padding: 3px 10px;
text-shadow: @text-shadow;
&:hover {
color: @gray;
}
}
}
}
&.ds-active {
span {
color: @gray;
}
ul {
display: block;
}
}
}
.ds-alert {
margin: 0.5em 0;
border: 1px solid #FBEED5;
border-radius: @border-radius;
padding: 6px 6px;
color: #C09853;
background-color: #FCF8E3;
line-height: 1.5em;
}
.ds-login-buttons {
width: 100%;
position: relative;
padding: 10px 0 6px;
//border-top: @border-shadow;
p {
float: left;
line-height: 24px;
margin: 0; // for compatible : div#main p
}
.ds-service-list li {
float: left;
height: 16px;
width: 54px;
padding:4px 0;
margin: 0 0 0 6px; // for compatible
//_margin-left:3px;
//line-height: 16px;
}
.ds-more-services {
color: @highlight ;
&:hover {
color: lighten(@highlight, 15%) ;
}
line-height:16px;
display:block;
}
.ds-additional-services {
display: none;
}
.ds-social-links{
float:left;
width:306px; // ie6 有3px margin的bug
}
&:after {
.clearfix();
}
}
a.ds-unread-comments-count {
display:none;
background-color: @highlight;
color: #FFFFFF ; // compatible;
margin-right: 6px;
padding: 1px 5px;
font-weight:bold;
.rounded(@border-radius-large);
box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 1px 1px rgba(0,0,0,.3);
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
&:hover {
background: #f00;
}
}
/* Reply Box */
.ds-replybox {
width: auto; // compatible 100%;
font-size: @font-size-small;
position: relative;
z-index: 3;
margin: 8px 0;
padding: 0 0 0 60px;
position:relative;
_zoom:1; // fix ie6 position padding bug
&:after {
.clearfix();
}
.ds-avatar {
position : absolute;
top: 0;
left: 0;
img {
width: @avatar-size;
height: @avatar-size;
visibility:visible; // for compatible overwrite lazyloader
margin: 0;
}
}
}
.ds-inline-replybox{ // 这种情况下,插入的位置一般已经留了padding,再额外增加下方的margin就没必要了
margin: 8px 0 2px 0;
padding-left:38px;
.ds-avatar img{
width: @avatar-small-size;
height: @avatar-small-size;
box-shadow: 0 1px 2px rgba(0,0,0,.22);
}
}
.ds-textarea-wrapper {
position: relative;
//z-index: 1;
border: @border-gray;
border-bottom: none;
padding-right: 20px;
background: #ffffff url("@{images-url}bg_sprites.png") 0 -90px repeat-x;
overflow: hidden;
textarea {
box-shadow: none;
-webkit-appearance: none; //remove inner shadow on mobile webkit
overflow: auto;
padding: 10px;
height: 54px;
margin: 0;
resize: none;
color: @gray-lighter;
width: 100%;
&:focus {
color: @gray-dark;
}
}
.ds-hidden-text{
word-wrap: break-word;
visibility: hidden;
position: absolute;
top: 0;
left:10px;
right:10px;
//z-index: -1;
}
textarea, .ds-hidden-text {
display: block;
font-family: @font-family-sans-serif;
font-size: @font-size-base;
line-height: 20px;
border: none;
}
}
.ds-post-toolbar {
position: relative;
//z-index: 4;
width: 100%;
span, input, label, a {
vertical-align: middle;
width:auto;
}
box-shadow: 0 1px 0 rgba(255,255,255, .6);
}
.ds-post-options {
position: relative;
margin-right: 100px;
height: 30px;
border: @border-gray;
border-right: none;
border-bottom-color: @dark-border-color;
border-bottom-left-radius: @border-radius;
-webkit-border-bottom-left-radius: @border-radius;
}
.ds-toolbar-buttons{
position: absolute;
top: 5px;
left: 6px;
}
.ds-toolbar-button {
display: block;
width: 19px ;
height: 19px;
float:left;
margin-right:4px;
.spritesheet();
vertical-align: middle;
opacity: 0.6;
.transition(opacity);
&:hover {
opacity: 1;
}
}
.ds-add-image {
background-position: 0 -48px;
&:hover {
background-position: 0 -66px;
}
/*
&:active {
position: absolute;
top: 8px;
}*/
}
.ds-add-emote {
background-position: 0 -12px;
&:hover {
background-position: 0 -30px;
}
/*
&:active {
position: absolute;
top: 6px;
}*/
}
.ds-sync {
font-size:@font-size-small;
color: @gray-lighter;
line-height: 30px;
position: absolute;
right: 5px;
label {
color: @gray-light;
cursor: pointer;
.transition(color);
&:hover {
color: @gray;
}
}
a.ds-service-icon, a.ds-service-icon-grey{
margin: 7px 2px 7px 3px;
}
}
.ds-post-button {
font-family: @font-family-sans-serif;
position: absolute;
right: 0;
top: 0;
height: 32px; // box-sizing : border-box;
width: 100px;
text-align: center;
text-shadow: @text-shadow;
color: @gray;
font-size: @font-size-large;
font-weight: bold;
border: @border-gray;
border-bottom-color: @dark-border-color;
border-bottom-right-radius: @border-radius;
-webkit-border-bottom-right-radius: @border-radius;
.gradient(#e6e6e6, #fcfcfc);
.transition(all);
box-shadow: inset 0 0 1px #fff;
&:hover {
background-position: 0 -15px;
color: @gray-dark;
}
&:active {
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
}
/* disqus 模式的登陆
.ds-auth-inline{
margin-top:8px;
}
.ds-guest-form{
float:left;
padding:10px 0 6px 6px;
border-left: @border-shadow;
input{
background: rgba(255,255,255,0.85);
padding: 7px 8px;
margin: 0;
border-radius: @border-radius;
border: 1px solid #c0c8d2;
font-size: @font-size-base;
height: 16px;
line-height:normal;
}
}
*/
/* Comments Info */
.ds-comments-info {
width: 100%;
//z-index: 2;
font-size: @font-size-base;
margin-top : 10px;
padding: 8px 0;
//height: 30px;
line-height: 25px;
position:relative;
//border-bottom: @border-shadow;
}
.ds-sort {
//font-size: 12px; // 原来是11px, 中文字体,小于12px在Windows里会出现锯齿
position:absolute;
right:0;
top: 8px;
a{
color: @text-muted;
padding: 0 4px; // padding更大可以扩大可点击区域
margin: 0 2px; // 仍然保留一点间隙,以免被误点
&:hover{
color: @link-hover-color;
}
&.ds-current, &:active{
color: @highlight;
}
}
}
ul.ds-comments-tabs{
.ds-highlight {
margin: 0 2px 0 0;
}
.ds-service-icon{
vertical-align: middle;
margin: 0 2px 1px 0;
}
}
li.ds-tab {
display:inline;
font-size: @font-size-base;
margin:0 5px 0 0;
padding:0; // for compatible
a {
text-shadow: @text-shadow;
padding: 3px 5px;
display: inline;
.rounded(@border-radius-large);
&.ds-current {
border: @border-gray;
background-color: rgba(0,0,0,.04);
}
&:hover {
background-color: rgba(0,0,0,.04);
}
}
}
/* Comments */
.ds-comments {
width: 100%; // clearfix
//overflow:hidden; // clearfix
//z-index: 2;
&:after {
// 可能会导致后面的div掉下去
// http://hvfun.co.uk/2012/07/oyster-card-paranoid/
.clearfix();
}
border-bottom: @border-shadow;
}
li.ds-post {
width:100%; // clearfix
overflow:hidden; // clearfix
clear: both;
//position: relative; post-self本身的relative的,所以就不需要它是relative了
border-top: @border-shadow;
margin:0; // for-compatible
padding:0; // for-compatible
list-style:none;// for-compatible
}
li.ds-post-placeholder{
text-align:center;
color:@text-muted;
padding:1em 0;
}
.ds-post-self {
position: relative;
padding: 10px;
border-top: @border-highlight;
&:after {
.clearfix();
}
&:hover {
.ds-post-delete, .ds-post-report {
display: inline-block;
}
}
}
&.ds-touch .ds-post-self{
.ds-post-delete, .ds-post-report {
display: inline-block;
}
}
.ds-comment-body {
padding-left: 60px;
p {
font-size: @font-size-base;
line-height: 1.5em;
margin: .5em 0;
word-wrap: break-word;
}
img {
max-width:100%;
vertical-align:text-bottom;
}
embed {
max-width:100%;
}
code {
display: block;
font-size: @font-size-small;
font-family: @font-family-monospace;
padding: 8px 12px;
background-color: #F0F0F0;
margin: 8px 0;
border-radius: @border-radius;
border: 1px solid #DDD;
color: #666;
}
a {
color: @link-color;
&:hover {
color: @gray;
}
}
}
a.ds-comment-context {
position: relative;
margin: .5em 0;
//font-size: @font-size-base; 不设置就跟p是一样的
color: lighten(@highlight, 15%);
&:hover {
color: @highlight;
}
}
#ds-bubble {
//display: none;
position: absolute;
background-color: #fff;
.rounded(@border-radius-large);
padding: 10px;
color: #333;
border: @border-dark;
box-shadow: 0 0 2px rgba(0,0,0,.2);
z-index: 9999;
font-size: @font-size-base;
a {
color: lighten(@highlight, 15%);
&:hover {
color: @highlight;
}
}
p {
line-height: 18px;
}
.ds-arrow-border {
border-top-color: #aaa;
bottom: -6px;
}
.ds-arrow {
left: 32px;
bottom: -5px;
}
}
#ds-ctx-bubble {
width: 300px;
.ds-bubble-footer{
padding: 6px 0 0 0;
line-height:18px;
}
}
#ds-user-card {
width: 276px;
min-height:@avatar-size;
.ds-avatar {
margin-right: 10px;
img {
width: @avatar-size;
height: @avatar-size;
}
}
.ds-user-name {
vertical-align:top;
display:inline-block;
max-width:8em;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
font-size:@font-size-large;
}
.ds-user-card-meta { margin:14px 0 0 62px; }
.ds-user-description {
border-top:1px dotted #ddd;
margin-top:0.5em;
color:#aaa;
}
.ds-service-icon{
margin-right: 3px;
}
}
.ds-comment-header {
padding-top: 1px;
}
.ds-comment-footer {
line-height : 1.5em;
span.ui-icon {
//vertical-align: baseline;
}
a{
margin: 0 6px 0 0;
padding: 0 6px 0 0;
}
}
.ds-comment-actions {
a {
font-size : @font-size-small;
color: @text-muted;
//vertical-align: top;
.ds-icon{
position: relative;
top: -1px;
}
}
}
.ds-user-name {
color: @gray-light;
font-size: @font-size-base;
margin-right: 8px;
}
.ds-post-likes {
}
.ds-post-liked .ds-icon-like {
background-position: 0 -130px;
}
.ds-post-liked{
a.ds-post-likes {
color: @highlight;
}
}
.ds-post-reply {
}
.ds-reply-active{
display: block;
.ds-post-reply {
color: @gray-dark;
.ds-icon {
opacity: 1;
}
}
}
.ds-post-delete, .ds-post-report {
display: none;
}
.ds-icon-heart {
width: 14px;
height: 13px;
background-position: 0 -130px;
}
.ds-icon-settings {
width: 12px;
height: 12px;
margin: 3px 4px 0px;
opacity: 1;
}
.ds-icon-like {
width: 14px;
height: 13px;
background-position: 0 -117px;
}
.ds-icon-share {
width: 18px;
height: 13px;
background-position: 0 -234px;
}
.ds-icon-reply {
width: 18px;
height: 13px;
background-position: 0 -105px;
}
.ds-icon-delete {
width: 13px;
height: 13px;
background-position: 0 -176px;
}
.ds-icon-report {
width: 12px;
height: 12px;
background-position: 0 -189px;
}
.ds-time {
font-size: @font-size-small;
*font-size: 12px; // ie6/7会把所有中文修正成12px,因此会出现字体大小不一样的问题。
margin-right: 8px;
color: @text-muted;
_zoom:1; // ie6 hack 为了触发layout
}
/* Child Comments */
/* 不再支持评论展开功能
.ds-children-control {
z-index: 99;
position: absolute;
display: inline-block;
height: 20px;
left: 0;
top: -9px;
.ds-collapse {
//display: none;
.ds-icon {
width: 20px;
height: 19px;
background-position: 0 -85px;
}
}
.ds-expand {
display: none;
.ds-icon {
width: 20px;
height: 20px;
background-position: 0 -143px;
}
}
}
.ds-children-wrapper {
position: relative;
&.ds-collapsed {
.ds-collapse {
display: none;
}
.ds-expand {
display: inline-block;
}
.ds-collapse-padding {
display: block;
}
.ds-children {
display: none;
}
}
}
.ds-collapse-padding {
display: none;
margin: 10px 0;
height: 10px;
}
*/
ul.ds-children {
margin-left: 38px;
.ds-avatar {
width: @avatar-small-size;
height: @avatar-small-size;
img {
width: @avatar-small-size;
height: @avatar-small-size;
}
}
.ds-post-self{
padding-left: 0;
}
.ds-comment-body {
padding-left: 38px;
}
}
/* Footer */
/* 加载更多的按钮
.ds-more {
text-align: center;
border-top: @border-shadow;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
font-weight: bold;
a {
.gradient(#e6e6e6, #ffffff);
.rounded(@border-radius);
.transition(all);
border: @border-dark;
display: inline-block;
font-size: 15px;
padding: 8px 40px 7px;
margin: 30px 0;
&:hover {
background-position: 0 -15px;
}
&:active {
top: 0;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
}
div {
border-top: @border-highlight;
}
}
*/
.ds-paginator {
border-bottom: @border-shadow;
text-align: right;
padding-bottom: 15px;
clear: both;
line-height: 1em;
div.ds-border {
border-top: @border-highlight;
margin-bottom: 15px;
}
a {
font-size:@font-size-small;
margin: 0 3px;
padding: 2px 5px;
border: 1px solid transparent;
&:hover, &.ds-current {
//font-weight: bold;
.rounded(@border-radius);
background-color: rgba(0, 0, 0, .03);
}
&.ds-current {
color: @highlight;
border: @border-gray;
//font-size: 14px;
}
}
}
.ds-powered-by {
font-size: @font-size-small;
text-align: right;
padding: 10px 0;
a {
color: @text-muted;
&:hover {
color: @gray;
}
text-decoration: none; // compatible
}
}
/* IE fix */
&.ds-no-transition { // ie 6/7/8/9 don't support transition
.ds-post-button, .ds-more a {
background: url("@{images-url}bg_sprites.png") repeat-x ;
&:hover {
background-position: 0 -30px ;
}
}
.ds-like-thread-button {
background: url("@{images-url}bg_sprites.png") repeat-x;
}
}
&.ds-no-opacity { // ie 6/7/8 don't support opacity and rgba
li.ds-post{ // no alpha //.ds-more,
border-top: 1px solid #ddd;
}
.ds-comments, .ds-paginator{
border-bottom: 1px solid #ddd;
}
.ds-post-self { // no alpha
border-top: none;
}
.ds-tab a.ds-current { // no alpha
background: @gray-background;
}
}
&.ds-ie6 { //IE6 specific
.ds-post-report, .ds-post-delete {
display: inline ;
}
.ds-textarea-wrapper {
padding: 10px 10px;
textarea {
width: 95%;
color: @gray-dark;
padding: 0;
}
}
/*
a.ds-collapse {
left: -25px;
}*/
.ds-post {
width: 100%;
float: left;
}
.ds-tab a.ds-current {
padding-bottom: 5px;
}
#ds-ctx-bubble {
.ds-arrow {
bottom: -8px;
}
.ds-arrow-border {
bottom: -9px;
}
}
}
}
#ds-thread.ds-narrow #ds-reset{
.ds-post-self {
padding:8px;
}
.ds-comment-body, .ds-replybox {
padding-left: 38px;
}
.ds-avatar{
img{
width:@avatar-small-size;
height:@avatar-small-size;
}
}
.ds-post-button{
width:70px;
}
.ds-post-options{
margin-right:70px;
}
}
#ds-smilies-tooltip {
border:@border-dark;
position:absolute;
width:400px;
background-color:#FFF;
z-index: 9999;
box-shadow: 0 0 2px rgba(0,0,0,.2);
text-shadow: @text-shadow;
.rounded(@border-radius);
a {
cursor:pointer;
}
ul {
list-style-type: none;
padding: 0;
margin:0;
}
ul.ds-smilies-tabs{
width:119px;
position: absolute;
top: 0;
left: 0;
height:159px;
overflow-y:auto;
background: @gray-background;
border-right: @border-gray;
border-top-left-radius: @border-radius;
border-bottom-left-radius: @border-radius;
li {
a {
color: @gray-lighter;
padding: 6px 10px;
display: block;
border-bottom: @border-gray;
.gradient2(#ffffff, #e9e9e9);
font-size: @font-size-small;
line-height: 1.3em;
}
&:first-child a {
border-top-left-radius: @border-radius;
}
a.ds-current {
color: #666;
background: #e3e3e3;
filter: none;
box-shadow: inset 0 0 4px rgba(0,0,0,.1);
}
}
}
.ds-smilies-container{
padding: 10px 5px;
height:140px;
margin-left: 125px;
overflow-y:auto;
li {
list-style: none;
float:left;
width: 26px;
height: 26px;
text-align:center;
cursor:pointer;
img {
visibility: visible; //部分用户装了类似于lazyloader的js插件,给网页所有img都加了个visibility:hidden; see: http://www.10why.net/20080924/san-lu-nai-fen/
}
&:hover {
position: relative;
top: -1px;
}
}
}
}