2011-12-10 41 views
1

我正在使用closure-stylesheets-20111202.jar来合并和缩小我所有的CSS。但是它在Twitter的bootstrap.css上抛出了一个错误,对我来说看起来很好。关闭样式表解析错误与Twitter的bootstrap.css

Compiler parsing error: Parse error in bootstrap.css at line 1404 column 95: 
background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); 

有什么想法?我知道我可以将他们已经缩小的版本连接到我的,但想知道是否有人有合适的解决方案。

回答

3

这是Closure Stylesheets中的一个错误。我正在修复。

基本上,GssParserCC.jj需要改变第59行:

private static final Pattern FUNCTIONS_WITH_SPACE_SEP_OK = Pattern.compile(
    "(?:-(?:O|MOZ|WEBKIT|MS)-)?(?:REPEATING-)?(?:LINEAR|RADIAL)-GRADIENT" 
    + "|RECT|-WEBKIT-GRADIENT|-KHTML-GRADIENT", 
    Pattern.CASE_INSENSITIVE); 

CssFunctionNode.java需要有-khtml-gradient添加到其列表中。

不过,这不会解决所有问题,因为封闭样式不承认但以下几点:

border-radius: 0 \0; 

特别是,它是被扔它关闭斜线。

虽然即使我更换符合:

border-radius: 0; 

然后我得到各个种类的96个错误。

--allow-unrecognized-functions得到这个数字下降到85

其余85的外观是这样的形式:

Detected multiple identical, non-alternate declarations in the same ruleset. If this is intentional please use the /* @alternate */ annotation. background-image:[-o-linear-gradient(top,#5bc0de,#339bb9)] in bootstrap.css at line 1872 column 1: 

没有标志,来禁止这种类型的时刻警告。

这次谈话可能是最好的对http://code.google.com/p/closure-stylesheets/issues/list

+0

部分修复检查:http://code.google.com/p/closure-stylesheets/source/detail?r=e1b66f7c9a72da09fd9876e6e1d243620aaf1cea – bolinfest