Less !important 关键字

在 Less 中,!important 关键字会将修饰的混入中的所有属性都标记为 !important。例子:

.foo (@bg: #f5f5f5, @color: #900) {
   background: @bg;
   color: @color;
}

.unimportant {
   .foo();
}

.important {
   // .foo 中的 background 和 color 将添加 !important 标记
   .foo() !important;
}

编译 less,输出的 CSS 如下:

.unimportant {
 background: #f5f5f5;
 color: #900;
}
.important {
 background: #f5f5f5 !important;
 color: #900 !important;
}
说说我的看法
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号