我正在使用 Sass 生成 CSS 样式表。我想要一致的排版,所以我想使用 http://orderedlist.com/our-writing/resources/html-css/thinning-text-in-webkit-safari/ 在基于 Webkit 的浏览器中细化文本。我认为这可以解决问题:
body
-webkit-text-stroke: 1px transparent
@media only screen and (max-device-width:480px)
body
-webkit-text-stroke:0 black
第一部分工作正常,但第二部分(移动 Safari 的例外)呈现为
@media only screen and (max-device-width:480px) { }
嗯!现在,显然 Sass 的下一个主要版本将支持括号,所以我可能只能添加 CSS 版本。但是有没有办法以适当的方式做我想做的事情呢?我已经尝试使用 \
转义 @media only
行,但这似乎导致 Sass 完全忽略该部分。
I'm using Sass to generate my CSS stylesheets. I want consistent typography, so I want to use the CSS rules from http://orderedlist.com/our-writing/resources/html-css/thinning-text-in-webkit-safari/ to thin the text in Webkit-based browsers. I thought this would do the trick:
body
-webkit-text-stroke: 1px transparent
@media only screen and (max-device-width:480px)
body
-webkit-text-stroke:0 black
The first part works fine, but the second part (the exception for mobile Safari) renders to
@media only screen and (max-device-width:480px) { }
Hmm! Now, apparently the next major release of Sass will support brackets, so I'll probably just be able to drop in the CSS version then. But is there a way to do what I'm trying to do in a properly Sassy way? I already tried escaping the @media only
line with a \
, but that seemed to cause Sass to ignore that section altogether.
发布评论
评论(1)
冒号和 0 之间需要有一个空格。
空格可以消除属性语法与选择器语法的歧义。
You need to have a space between the colon and 0.
The space disambiguates the property syntax from selector syntax.