Sass 3.2.0 发布,CSS 预处理器
Sass 3.2.0 发布了,Sass 扩展了 CSS3,增加了规则、变量、混入、选择器、继承等等特性。Sass 生成良好格式化的 CSS 代码,易于组织和维护。
Sass 3.2.0 版本主要改进记录:
1. mixin支持内容块嵌入(Reference Documentation):
@mixin iphone { @media only screen and (max-width: 480px) { @content; } } @include iphone { body { color: red } }
2. 占位符选择器 %foo
// This ruleset won't be rendered on its own. #context a%extreme { color: blue; font-weight: bold; font-size: 2em; }.notice { @extend %extreme; }//将编译生成#context a.notice { color: blue; font-weight: bold; font-size: 2em; }
3. 变量参数
@mixin box-shadow($shadows...) { // $shadows is a list of all arguments passed to box-shadow -moz-box-shadow: $shadows; -webkit-box-shadow: $shadows; box-shadow: $shadows; } // This is the same as "@include spacing(1, 2, 3);" $values: 1, 2, 3; @include spacing($values...);
4. 指令插值
$media: screen; $feature: -webkit-min-device-pixel-ratio; $value: 1.5; @media #{$media} and ($feature: $value) { ... }
该版本还包含其他的一些小改进,详情请看 CHANGES
相关推荐
RedCode 2020-10-28
teresalxm 2020-06-05
沈宫新 2020-05-28
dazhifu 2020-05-19
buttonChan 2020-05-10
nicepainkiller 2020-02-23
vavid 2020-02-15
tianzyc 2020-02-01
nicepainkiller 2020-01-29
dazhifu 2020-01-25
CaiKanXP 2020-01-08
葉無聞 2019-12-30
waterv 2019-12-27
福叔 2019-12-27
swiftwwj 2019-12-27
MaureenChen 2019-12-26