3.混合Mixin

SASS 的 @mMixin 的定義方式,MIXIN定義裡面還可以增加嵌套。

Mixin裡面的參數

@mixin alert($text-color, $background) {
    color: $text-color;
    background-color: $background;
    a{
        color: darken($text-color, 10%);
    }
}

.alert-warning {
    @include alert(#e69813,#f00909);
}
.alert-info {
    @include alert($background:#fff, $text-color:#13e61e);
}

Last updated