除了Idriss个答案:
在CSS中,我们按照下面的描述编写代码,全文如下.
body{
width: 800px;
color: #ffffff;
}
body content{
width:750px;
background:#ffffff;
}
在SCSS中,我们可以使用@mixin
来缩短这段代码,这样我们就不必一遍又一遍地编写color
和width
属性.我们可以通过函数定义它,类似于PHP或其他语言.
$color: #ffffff;
$width: 800px;
@mixin body{
width: $width;
color: $color;
content{
width: $width;
background:$color;
}
}
然而,在无礼中,整个 struct 在视觉上比SCSS更快、更干净.
它目前似乎不支持内联CSS.
$color: #ffffff
$width: 800px
$stack: Helvetica, sans-serif
body
width: $width
color: $color
font: 100% $stack
content
width: $width
background:$color