在调用 mixin 时,如果在后面追加 !important 关键字,就可以将 mixin 里面的所有属性都标记为 !important。如,以下Less代码:
.mixin() {color: #900;background: #F7BE81;}h2 {.mixin() !important;}
编译后的CSS代码为:
h2 {color: #900 !important;background: #F7BE81 !important;}
在调用 mixin 时,如果在后面追加 !important 关键字,就可以将 mixin 里面的所有属性都标记为 !important。如,以下Less代码:
.mixin() { color: #900; background: #F7BE81;}h2 { .mixin() !important;}编译后的CSS代码为:
h2 { color: #900 !important; background: #F7BE81 !important;}相关文章: