Sass存储选择器在变量中 [英] Sass store selector in variable

查看:88
本文介绍了Sass存储选择器在变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图在SASS中保存一个选择器,以便以后更容易引用,但是我得到一个语法错误。 p>

  $ icon:[class * =icon]; 


解决方案

如果你想要将它转换为字符串以将其用作变量:

  $ icon:'[class * =icon]' 

#{$ icon} {
// stuff
}


I am trying to save a selector in SASS for easier referencing later, however I get a syntax error.

Here's what I'm trying to do:

$icon:  [class*="icon"];

解决方案

You need to convert it to a string if you want to use it as a variable:

$icon: '[class*="icon"]';

#{$icon} {
    // stuff
}

这篇关于Sass存储选择器在变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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