我想在 mixin 调用中做一个简单的插值:
$models: "square", "square-green", "circle";
$services: "facebook", "twitter", "linkedin", "gplus", "feed";
@each $model in $models {
@include all-#{$model}-sprites;
@each $service in $services {
#{$model}-#{$service} {
&:hover{ @extend .#{$model}-#{$service}-hover;};
}
}
}
错误 sass/soboo2.scss(第 14 行:“@include all-”之后的无效 CSS:预期的“}”,是“#{$model}-sprites;”)
我还尝试了互联网上的一些语法变体:
@include all-"#{$model}"-sprites;
@include [all-#{$model}-sprites];
@include [all-"#{$model}"-sprites];
@include all-$model-sprites;
不起作用...有什么建议吗?