scss\sass calc 的mixin&include 处理方法
How can I create a calc mixin to pass as an expression to generate tags?
@mixin calc($property, $expression) {
#{$property}: -webkit-calc(#{$expression});
#{$property}: calc(#{$expression});
}
.test {
@include calc(width, "25% - 1em");
}
Will render as
.test {
width: -webkit-calc(25% - 1em);
width: calc(25% - 1em);
}