我怎么能按照我的预期让它发挥作用?
// https://github.com/thoughtbot/bourbon/blob/master/app/assets/stylesheets/addons/_size.scss
@mixin size($size) {
$height: nth($size, 1);
$width: $height;
@if length($size) > 1 {
$height: nth($size, 2);
}
@if $height == auto or (type-of($height) == number and not unitless($height)) {
height: $height;
}
@if $width == auto or (type-of($width) == number and not unitless($width)) {
width: $width;
}
}
$height:10;
.sample {
@include size(10px $height + px)
}
我希望输出为:
.sample {
height: 10px;
width: 10px;
}