我想在 SASS/Compass 中添加背景,不知道现有的背景字符串。我可以通过写入全局变量来完成,但这似乎很草率。
伪:
=mixin-add-icon
// add a background icon
=mixin-add-gradient-from-color($color: blue !default)
// add a background gradient
=mixin-add-texture-bg
// add a bg texture
a
background: blue
+mixin-add-texture-bg
// this should take the existing bg and add texture to it
&.selected
+mixin-add-gradient-from-color()
+mixin-add-icon
// these two should take the existing bgs strings from <a> and add to them
我错过了一些明显的东西吗?提前致谢。