我正在尝试自动构建一些选择器来帮助对 zurb 基础弹出窗口进行着色。
我很确定我以前有过这个工作。但在我进入细节之前,这里是 sass :
.flyout
@each $color in (green, brown, blue, darkred, maroon, saddlebrown)
&.#{$color}
border: 1px solid tint($color, 10%)
background: tint($color, 20%)
我很确定会有一些人被我的方法冒犯,不管我希望结果看起来像:
.flyout.green{
border: 1px solid the-ten-percent-tinted-green;
background: the-twenty-percent-tinted-green;
}
... etc, etc
相反,我得到:
>>> Change detected at 12:08:57 to: components/zurb/_flyout.sass
error sass/app.sass (Line 132 of sass/components/zurb/_flyout.sass: Invalid CSS after "&.": expected class name, was "#8b4513")