我是一个新手,在SASS和编程语言方面都不太熟悉。
.row
{
@include make-row;
}
在上述的
@include
中,它是否等同于sass中的@import
函数?你能解释一下@include
的功能吗?@import导入整个文件,@include包含@mixin代码片段。它允许你创建可重复使用的代码。
@mixin example($color, $style, $weight) {
border: $color, $style, $weight;
width: 100px;
height: 100px
padding: 10px;
}
.box {
@include example(#000, solid, 1px);
}
@mixin blue-text {
color: blue;
}
span {
@include blue-text;
}
(以下内容需要上下文)
span {
color: blue;
}