多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
#### @for 循环 ~~~ @for $i from 1 to 13{ .col-#{$i}{ width: 100%/12*$i; } } @media(min-width:768px) and (max-width:992px){ @for $i from 1 to 13{ .col-sm-#{$i}{ width: 100%/12*$i; } } } ~~~ * * * * * #### @import 引入其他css @import "base.css"; * * * * * #### 嵌套 ~~~ div{ p{ color: yellow; &:hover{ color: green; } } &:hover{ color: aliceblue; } } ~~~ * * * * * //可以做定制化的传参 //下面默认值为100px;可以自由改变,通过$w,$h可以改变元素 //定义公共的css样式 #### @mixin ~~~ @mixin wh($w:100px,$h:100px){ width: $w; height:$h; } .one{ @include wh; background: red; } .two{ @include wh(200px,200px); background:yellow; } ~~~ * * * * * #### @extend实现继承 .head{ width: 100px; height: 100px; background: #333; } .foot{ @extend .head; } * * * * * #### 能定义变量 $bg: #ff2d51; $fontColor: #333; $m-font:14px; body{ background: $bg; color: $fontColor; font-size: $m-font; background-color: yellow; }