我遇到了一个Sass错误:声明只能在样式规则中使用。
以下是该文件的内容:
╷
32 │ #{$property}: $value;
│ ^^^^^^^^^^^^^^^^^^^^
以下是该文件的内容:
@mixin theme($colour, $texture: null) {
$theme: map-get-strict($themes, $colour, "theme");
@if ($texture) {
@include getTexture($texture);
}
@each $property, $value in $theme {
#{$property}: $value;
}
}
这里使用的是dart-sass。
我认为可能是一个Sass测试文件引起了问题,例如:
@include it('outputs the light-blue theme') {
@include assert {
@include output {
@include theme(light-blue);
}
@include expect {
background-color: getColour(light-blue);
color: getColour(black);
}
}
}