Twitter 的 bootstrap.css 的闭包样式表解析错误

发布于 2024-12-20 23:46:06 字数 362 浏览 6 评论 0原文

我正在使用closure-stylesheets-20111202.jar 来组合和缩小我的所有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));

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

I'm using closure-stylesheets-20111202.jar to combine and minify all my CSS. However it's throwing an error on the Twitter's bootstrap.css on something that looks fine to me.

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));

Any thoughts? I know I can just concatenate their already minified version to mine but was wondering if anyone had a proper solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

渔村楼浪 2024-12-27 23:46:06

这是闭包样式表中的一个错误。我正在努力修复。

基本上,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/ 上进行此对话闭包样式表/问题/列表

this is a bug in Closure Stylesheets. I am working on a fix.

Basically, GssParserCC.jj needs to change on line 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);

and CssFunctionNode.java needs to have -khtml-gradient added to its list.

However, that will not fix everything because Closure Stylesheets does not recognize the following yet:

border-radius: 0 \0;

In particular, it's the slash that is throwing it off.

Though even if I replace that line with:

border-radius: 0;

Then I get 96 errors of various sorts.

--allow-unrecognized-functions gets that number down to 85.

The remaining 85 look to be of the form:

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:

There is no flag to suppress this type of warning at the moment.

This conversation is probably best had on http://code.google.com/p/closure-stylesheets/issues/list

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文