我想在SASS / Compass中添加背景,不知道现有的背景字符串。我能够通过写一个全局var来完成,但它似乎很草率。
伪:
=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
我错过了一些明显的东西吗?提前谢谢。