我想使用Sass内置的@each方法来缩短此代码:
.svg-circle-full {
@include mixinSVG((
'svg': $svgvar-icn-circle-full,
'isWide': false
)...);
}
.svg-circle-empty {
@include mixinSVG((
'svg': $svgvar-icn-circle-empty,
'isWide': false
)...);
}
.svg-circle-half {
@include mixinSVG((
'svg': $svgvar-icn-circle-half,
'isWide': false
)...);
}
基本上,我需要能够使用mixinSVG mixin中@each循环中的变量名。我正在尝试这一点,但当它碰到“svg”属性中的@each变量时失败了:
@each $state in full, empty, half {
.svg-circle-#{$state} {
@include mixinSVG((
'svg': $svgvar-icn-circle-#{$state},
'isWide': false
)...);
}
}