我使用了2个Mixins来设置圆角边框:
// When the Input is 1 Variable
@mixin border-radius($pixel) {
border-radius: $pixel;
}
// When the Inputs are 4 Variables
@mixin border-radius-s($tl, $tr, $br, $bl) {
border-top-left-radius: $tl;
border-top-right-radius: $tr;
border-bottom-right-radius: $br;
border-bottom-left-radius: $bl;
}
我正在尝试找到一种方法将这些mixin合并为一个!可能需要使用if else
语句来处理输入。我已经尝试过了,但是没有找到好的可行解决方案。
有人可以帮助我吗?
border-radius
前加前缀,而且你肯定不支持需要供应商前缀的浏览器(参见支持表)。这基本上只会浪费你所有客户端的带宽。 - Fabrício Matté@include border-radius(3px)
,输出将是border-radius: 3px
,如果我编写@include border-radius(3px, 2px, 3px, 2px)
等。 - Mini John