美文网首页
less-关键字

less-关键字

作者: 子心_ | 来源:发表于2019-06-13 22:07 被阅读0次
.foo (@bg: #f5f5f5, @color: #900) {
  background: @bg;
  color: @color;
  font-size: 16px;
  font-weight: 900;
}

.unimportant {
  .foo();
}
.important {
  .foo() !important;
}

生成的css:

.unimportant {
  background: #f5f5f5;
  color: #990000;
  font-size: 16px;
  font-weight: 900;
}
.important {
  background: #f5f5f5 !important;
  color: #990000 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

相关文章

网友评论

      本文标题:less-关键字

      本文链接:https://www.haomeiwen.com/subject/wtaefctx.html