Scss混合宏的不足

css yekong 958℃

Scss混合宏的不足之处是会生成冗余的代码块。

@mixin border-radius{
  -webkit-border-radius: 3px;
  border-radius: 3px;
}

.box {
  @include border-radius;
  margin-bottom: 5px;
}

.btn {
  @include border-radius;
}

编译后

.box {
  -webkit-border-radius: 3px;
  border-radius: 3px;
  margin-bottom: 5px;
}

.btn {
  -webkit-border-radius: 3px;
  border-radius: 3px;
}

无法智能的将相同的样式代码块合并在一起。

喜欢 (0)