我在另一个mixins中有一个mixins
.background(@url: @base-url , @repeat: repeat, @pos1: left, @pos2: center, @color: transparent){
background:@arguments;
}
用于:
.divider{
overflow:hidden;
.background(@url: url("@{base-url}/divider.png") , @repeat: repeat-x, @pos2: bottom);
}
.class{
.divider;
}
是否可以仅更改@pos2
mixins中的.divider
?
答案 0 :(得分:2)
当然,您可以在.divider
mixin中添加参数并使用该参数:
.divider(@pos2: bottom) {
overflow:hidden;
.background(url("@{base-url}/divider.png"), repeat-x, @pos2);
}
.class{
.divider(top); // you can use whatever value you want, or ignore it to use the default value 'bottom'
}