【发布时间】:2017-12-26 05:57:44
【问题描述】:
我正在尝试编写循环混合来迭代地增加背景颜色的饱和度。这是最新的 mixin 代码:
@mixin generateBackgroundSteps($cell-count, $color) {
@for $i from 0 through $cell-count - 1 {
$percent: (5 * $i) + "%";
$new-color: saturate($color, $percent);
&[setting-id="#{$i}"] {
background-color: $new-color;
}
}
}
无论我如何改变它,生成的 css 仍然是这样的:
.rubric-design .rubric .create-new-criteria .create-criteria-initial-
settings .create-criteria-setting[setting-id="2"] {
background-color: saturate(#90afc8);
}
也许这就是我形成 $percent 的方式。这一定很明显!
【问题讨论】: