replace(/(\s|:|,)0(px|em|ex|cm|mm|in|pt|pc|%)/g, '$1' + '0');
replace(/rect\(0(px|em|ex|cm|mm|in|pt|pc|%)/g, 'rect(0');
+ // restore 0% in hsl/hsla
+ replace(/(hsl|hsla)\(([^\)]+)\)/g, function(match, colorFunction, colorDef) {
+ var tokens = colorDef.split(',');
+ if (tokens[1] == "0") tokens[1] = '0%';
+ if (tokens[2] == "0") tokens[2] = '0%';
+ return colorFunction + "(" + tokens.join(',') + ")";
+ });
+
// none to 0
replace(/(border|border-top|border-right|border-bottom|border-left|outline):none/g, '$1:0');
'p{border:1px solid #f94311}'
],
'colors and colons': 'a{background-image:linear-gradient(top,red,#e6e6e6)}',
- 'colors and parentheses': 'a{background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6))}'
+ 'colors and parentheses': 'a{background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6))}',
+ 'hsl percents': 'a{color:hsl(1,0%,0%)}',
+ 'hsla percents': 'a{color:hsl(1,0%,0%)}',
+ 'hsl one percent': 'a{color:hsl(80,100%,0%)}',
+ 'hsla custom ': 'a{color:hsl(80,30%,50%,.5)}',
}),
'font weights': cssContext({
'font-weight:normal to 400': [