0

我想在 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

我错过了一些明显的东西吗?提前致谢。

4

1 回答 1

1

目前没有办法通过 Sass 访问对象的属性,但 Sass 是一个开放项目,因此您可以随时询问开发人员是否可以在他们的Github repo上提供这样的功能。

于 2012-05-07T20:27:27.453 回答