简体   繁体   English

Google Closure样式表使用@media only屏幕解析错误

[英]Google Closure Stylesheets parse error with @media only screen

I'm using closure-stylesheets-20111230.jar to combine and minify all my CSS. 我正在使用闭包样式表-20111230.jar来组合和缩小所有CSS。 However it's throwing parsing error with @media only screen and (min-device-width : 320px) on something that looks fine to me. 但是,它在仅@media屏幕和(min-device-width:320px)上抛出解析错误,出现在我觉得合适的地方

Google closure-stylesheets.jar to parse css: 谷歌closure-stylesheets.jar来解析css:

java -jar closure-stylesheets.jar ..\\data\\css\\mycss.css --output-file ..\\data\\css\\myresult.css java -jar Closure-stylesheets.jar .. \\ data \\ css \\ mycss.css-输出文件.. \\ data \\ css \\ myresult.css

CSS code: CSS代码:

@media only screen 
and (min-device-width : 320px)
and (max-device-width : 480px) {
.switchMobile{ padding: 33px 0 0 0; height: 90px; }
.switchMobile a { font-size: 300%; }   
#closeMobileLink{ margin: -60px 20px; }   
} 

Any thoughts? 有什么想法吗? I have just use their closure-stylesheets.jar file but was wondering if anyone had a proper solution. 我只是使用他们的closure-stylesheets.jar文件,但想知道是否有人有合适的解决方案。 Thanks! 谢谢!

I know this question is really very old. 我知道这个问题真的很老了。 The question does not include any parsing error message. 该问题不包括任何分析错误消息。 On 'new' closure-stylesheets I can't compile your stylesheet because of the space between min-device-width and the colon; 在“新”关闭样式表上,由于min-device-width和冒号之间的间隔,我无法编译您的样式表。 I also get an error message pointing this out. 我也收到一条错误消息指出这一点。

Compiler parsing error: Parse error in stylesheet.gss at line 2 column 22:
and (min-device-width : 320px)

If I remove the space, the stylesheet compiles without issues. 如果删除空格,则样式表编译不会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM