Skip to content

Commit

Permalink
Don't bork Safari by removing spaces in front of parens in @media lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 23, 2009
1 parent 04665d5 commit 0e290b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/com/yahoo/platform/yui/compressor/CssCompressor.java
Expand Up @@ -85,7 +85,14 @@ public void compress(Writer out, int linebreakpos)
}
m.appendTail(sb);
css = sb.toString();

// Remove spaces before the things that should not have spaces before them.
css = css.replaceAll("\\s+([!{};:>+\\(\\)\\],])", "$1");

// Put the space back in some cases, to support stuff like
// @media screen and (-webkit-min-device-pixel-ratio:0){
css = css.replaceAll("(@media[^{]*[^\\s])\\(", "$1 (");

css = css.replaceAll("___PSEUDOCLASSCOLON___", ":");

// Remove the spaces after the things that should not have spaces after them.
Expand Down

0 comments on commit 0e290b8

Please sign in to comment.