【问题标题】:Inherit styles from button mixin inside small breakpoint从小断点内的按钮混合继承样式
【发布时间】:2017-08-30 18:46:18
【问题描述】:

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

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

    • 是的,这是可能的,但不是预期的结果。
    猜你喜欢
    • 2016-05-13
    • 2014-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多