Less 在mixin中可以有可选值吗?
有了optional,我指的是真正可选的,即没有默认的回退值Less 在mixin中可以有可选值吗?,less,mixins,optional-parameters,Less,Mixins,Optional Parameters,有了optional,我指的是真正可选的,即没有默认的回退值 .fontEMSmall(@color: "", @weight: 300) { font-weight: @weight; color: @color; font-size: 0.875em; line-height: 140%; } .fontEMSmall(@color: "", @weight: 300) { if(@color) color: @color; font-weight: @weight;
.fontEMSmall(@color: "", @weight: 300) {
font-weight: @weight; color: @color;
font-size: 0.875em; line-height: 140%;
}
.fontEMSmall(@color: "", @weight: 300) {
if(@color) color: @color;
font-weight: @weight;
font-size: 0.875em; line-height: 140%;
}
我希望能够使用.fontEMSmall而不必指定它与颜色一起工作的颜色:但它不是有效的CSS。。i、 例如
.fontEMSmall(@color: "", @weight: 300) {
if(@color) color: @color;
font-weight: @weight;
font-size: 0.875em; line-height: 140%;
}
这可能吗?请参见和,例如:
.fontEMSmall(@color: "", @weight: 300) {
if(@color) color: @color;
font-weight: @weight;
font-size: 0.875em; line-height: 140%;
}