我经常使用 mixins 来存储代码块。例如:
@mixin ui-spot-badges($ui-spot-badges: ui-spot-badges) {
.#{$ui-spot-badges} {
position:relative;
@content;
&:after {
content:"";
position:absolute;
background:red;
}
}
}
@include ui-spot-badges(myclass);
我怎样才能将一个以上的类传递给mixin。例如
@include ui-spot-badges(myclass, myclass2);
要得到
.myclass, myclass2 {
position:relative;
}
.myclass:after, .myclass2:after {
content:"";
position:absolute;
background:red;
}