Sass - 在多值规则中使用变量
Sass 变量可以这样使用:
!blue = #3bbfce
.content_navigation
border-color = !blue
color = !blue - #111
这对于“单值”变量非常有效。我无法在“多值”CSS 规则上使用它们,例如背景:
!blue = #3bbfce
//this doesn't work
.content_navigation
background =!blue url(/path/to/image) 0 0 no-repeat
我该怎么做?
Sass variables can be used like this:
!blue = #3bbfce
.content_navigation
border-color = !blue
color = !blue - #111
This works very well on "single-value" variables. I'm not able to use them on "multi-value" css rules, such as background:
!blue = #3bbfce
//this doesn't work
.content_navigation
background =!blue url(/path/to/image) 0 0 no-repeat
How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
接受的答案是旧的、已弃用的语法。查看新的 Sass 3 语法:
http:// nex-3.com/posts/94-haml-sass-3-beta-released
这将是 Sass 3 方式,使用缩进语法:
The accepted answer is old, deprecated syntax. Have a look at the new Sass 3 syntax:
http://nex-3.com/posts/94-haml-sass-3-beta-released
This would be the Sass 3 way, using the indented syntax:
正确的语法应该是这样的:
享受 SASS!
The right sintax should be something like this:
Enjoy SASS!