Permalink
Browse files

Fix for css minification of #feedback is not a color

  • Loading branch information...
Brad Robinson
Brad Robinson committed Apr 27, 2011
1 parent dc11ed2 commit 3f2c25ea2bcd865fc5ac37cb3c9a02490f904a0a
Showing with 8 additions and 3 deletions.
  1. +2 −2 MiniME/CssMin.cs
  2. +6 −1 MiniMETestCases/TestScripts/css_colors.txt
View
@@ -107,15 +107,15 @@ public string Minify(string input, int MaxLineLength)
);
// normalize #aBc to #ABC. These will be in groups of either 3 or 6
input = Regex(@"#([a-fA-F0-9]{3}){1,2}").Replace(input, m => m.Value.ToUpperInvariant());
input = Regex(@"#([a-fA-F0-9]{3}){1,2}\b").Replace(input, m => m.Value.ToUpperInvariant());
// Shorten colors from #AABBCC to #ABC. Note that we want to make sure
// the color is not preceded by either ", " or =. Indeed, the property
// filter: chroma(color="#FFFFFF");
// would become
// filter: chroma(color="#FFF");
// which makes the filter break in IE.
input = Regex(@"([^""'=\s])(\s*)#([0-9A-F])\3([0-9A-F])\4([0-9A-F])\5").Replace(input, "$1$2#$3$4$5");
input = Regex(@"([^""'=\s])(\s*)#([0-9A-F])\3([0-9A-F])\4([0-9A-F])\5\b").Replace(input, "$1$2#$3$4$5");
// Replace multiple semi-colons in a row by a single one
// See SF bug #1980989
@@ -12,6 +12,11 @@ div
color:#11aaff;
}
div#feedback
{
color:#feedba;
}
-----
div{color:#6496C8;color:#ABCDEF;color:#1AF}
div{color:#6496C8;color:#ABCDEF;color:#1AF}div#feedback{color:#FEEDBA}
-----

0 comments on commit 3f2c25e

Please sign in to comment.