传递一个 mixin 一个列表和一个变量
Pass a mixin a list and a variable
是否可以传递参数列表以及另一个单独的参数。
类似于
@mixin cols($width...,$gutter) {
....
}
@include cols((4,4,4),2%);
我认为是的,我们可以做到 that.non 列表参数应该在 list/array 参数之前
检查这个片段
@mixin box-shadow($color,$shadows...) {
-moz-box-shadow: $shadows;
-webkit-box-shadow: $shadows;
box-shadow: $shadows;
background:$color;
}
.shadows {
@include box-shadow('red',0px 4px 5px #666, 2px 6px 10px #999);
}
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variable_arguments
希望对您有所帮助
是否可以传递参数列表以及另一个单独的参数。
类似于
@mixin cols($width...,$gutter) {
....
}
@include cols((4,4,4),2%);
我认为是的,我们可以做到 that.non 列表参数应该在 list/array 参数之前
检查这个片段
@mixin box-shadow($color,$shadows...) {
-moz-box-shadow: $shadows;
-webkit-box-shadow: $shadows;
box-shadow: $shadows;
background:$color;
}
.shadows {
@include box-shadow('red',0px 4px 5px #666, 2px 6px 10px #999);
}
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variable_arguments
希望对您有所帮助