Minify less CSS

114 views
Skip to first unread message

Joey Smith

unread,
Nov 14, 2014, 2:43:47 PM11/14/14
to yuicom...@googlegroups.com
I feel like this code is just creating far more problems than it fixes; we don't keep good track of the original state, and the times where the specific syntax matters has grown larger than the cases where it doesn't. My thought is to remove this entire block from the CSS minifier code:




// Replace 0(px,em,%) with 0. css = css.replaceAll("(?i)(^|[^.0-9])(?:0?\\.)?0(?:px|em|%|in|cm|mm|pc|pt|ex|deg|g?rad|m?s|k?hz)", "$10");
// Replace x.0(px,em,%) with x(px,em,%).
css = css.replaceAll("([0-9])\\.0(px|em|%|in|cm|mm|pc|pt|ex|deg|g?rad|m?s|k?hz| |;)", "$1$2");
// Replace 0 0 0 0; with 0.
css = css.replaceAll(":0 0 0 0(;|})", ":0$1");
css = css.replaceAll(":0 0 0(;|})", ":0$1");
css = css.replaceAll(":0 0(;|})", ":0$1");

Sure, it will mean we're slightly less agressive about how we minify CSS; however, I think it will also mean we BREAK less CSS. Any thoughts, concerns, etc. are hereby solicited.
Reply all
Reply to author
Forward
0 new messages