有没有办法我只能在小的断点中设置$ expand并从上面继承$ background和$ background-hover?
&__close {
@include button($background: $success-color, $background-hover: auto);
@include breakpoint(small only) {
@include button($background: $success-color, $background-hover: auto, $expand: true);
}
}
答案 0 :(得分:0)
将button()
参数默认为示例中的某些值是否可能是“中间路径”?然后你可以重新排列参数的顺序,只覆盖$expand
值,如下所示:
// @mixin button()
@mixin button( $expand: false, $background: $success-color, $background-hover: auto ) {
// All the button stuff
}
// Your selector
&__close {
@include button();
@include breakpoint(small only) {
@include button($expand: true);
}
}