有没有办法让我只能在小的唯一断点中设置$expand并从上面继承$background和$background悬停?
&__close {
@include button($background: $success-color, $background-hover: auto);
@include breakpoint(small only) {
@include button($background: $success-color, $background-hover: auto, $expand: true);
}
}
将
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);
}
}