SASS:获取现有背景字符串的值并添加到它? [英] SASS: Get value of existing background string and add to it?

查看:132
本文介绍了SASS:获取现有背景字符串的值并添加到它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在SASS / Compass中添加性地构建背景,忽略现有的背景字符串。

I'd like to additively build backgrounds in SASS/Compass, ignorant of the existing background string. I am able to accomplish by writing to a global var, but it seems sloppy.

伪:

=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

我缺少一些明显的东西?提前感谢。

Am I missing something obvious? Thanks in advance.

推荐答案

目前没有通过Sass访问对象属性的方法,但Sass是一个开放项目因此您可以随时访问开发人员,如果这些功能在 Github repo 上可以实现。

There isn't currently a way to access an object's properties via Sass, but Sass is an open project so you can always go and ask the developpers if such a feature would be possible on their Github repo.

这篇关于SASS:获取现有背景字符串的值并添加到它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆