google / closure-stylesheets

A CSS+ transpiler that lints, optimizes, and I18n-izes
Apache License 2.0
314 stars 65 forks source link

Compiler does not handle backslashes properly #39

Closed iflan closed 9 years ago

iflan commented 9 years ago

Originally reported on Google Code with ID 20

Discovered when trying to compress output from Twitter Bootstrap (likely affects lots
of other users too).

Michael Bolin addressed this issue in this thread but I don't see a fix ever being
checked in:

http://stackoverflow.com/questions/8453719/closure-stylesheets-parse-error-with-twitters-bootstrap-css

Input:
.test{ font-size:20px;outline:thin dotted \9; }

Output
GssParserException: Parse error in test at line 1 column 44

Reported by ori.schwartz on 2012-05-30 17:58:08

iflan commented 9 years ago
Can't you use a star instead of the backslash? As far as I can see, Closure-Stylesheets
doesn't have a problem with a star, and the IE hack should work with any prepended
character, not only a blackslash, see http://en.wikipedia.org/wiki/CSS_filter#Star_hack.

Reported by oliver.siemoneit on 2012-06-24 12:31:22

iflan commented 9 years ago
* hack works for: IE8 Quirks, IE8 IE7 Standards, IE7 Quirks, IE7 IE7 Standards, IE6
* hack DOES NOT WORK for: IE8 IE8 Standards
\9 hack WORKS for: IE8 IE8 Standards, IE8 IE7 Standards, IE8 Quirks mode, IE7 Quirks,
IE7 Standards (all varieties of IE8), IE6

http://webdood.com/?p=57

Reported by nixsid on 2012-07-27 04:01:24

iflan commented 9 years ago

@fleaflicker, @siderakis, we generally don't support browser-detection hacks in Closure Stylesheets as we prefer using @if to create browser-specific stylesheets. The one hack we support is the star hack and we still strongly discourage that.