【发布时间】:2018-09-07 04:36:46
【问题描述】:
我知道
.bg {
&-orange { background-color: $orange; }
&-yellow { background-color: $yellow; }
&-blue { background-color: $blue; }
&-green { background-color: $green; }
}
会变成
.bg-orange { background-color: $orange; }
.bg-yellow { background-color: $yellow; }
.bg-blue { background-color: $blue; }
.bg-green { background-color: $green; }
但是如果我想要最后的“bg”呢?
.orange-bg { background-color: $orange; }
.yellow-bg { background-color: $yellow; }
.blue-bg { background-color: $blue; }
.green-bg { background-color: $green; }
如何使用 SASS 完成此任务?有什么想法吗?
【问题讨论】:
-
那里没有捷径。你没有逆树结构。
-
拥有它们会很棒
标签: sass