Sass 输出一个计算?
如何将计算结果输出到内容 例如:Sass 输出一个计算?,sass,Sass,如何将计算结果输出到内容 例如: @for $i from 1 through 8 { .list-el { $test: calc($i * 10); &:before { content: '#{$test}'; } } } 上面只输出计算值calc($i*10),而不是结果。我希望看到一个列表:10、20、30、40、50、60、70、80只需删除“calc()” calc不在Sass中计算
@for $i from 1 through 8 {
.list-el {
$test: calc($i * 10);
&:before {
content: '#{$test}';
}
}
}
上面只输出计算值calc($i*10)
,而不是结果。我希望看到一个列表:10、20、30、40、50、60、70、80
只需删除“calc()”
calc
不在Sass中计算,浏览器本身接收公式并对其进行计算。您将无法在Sass中输出计算值。
@for $i from 1 through 8 {
.list-el {
$test: $i * 10;
&:before {
content: '#{$test}';
}
}
}