从小断点内的button mixin继承样式

时间:2017-04-05 08:52:29

标签: css sass zurb-foundation zurb-foundation-6

有没有办法我只能在小的断点中设置$ 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);
    }
}

1 个答案:

答案 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);
    }
}