2011-12-10 25 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