})
replace(/([^"'=\s])\s*#([0-9a-f]{6})/gi, function(match, prefix, color) { // long hex to short hex
if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5])
- return prefix + '#' + color[0] + color[2] + color[4];
+ return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color[0] + color[2] + color[4];
else
- return prefix + '#' + color;
+ return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color;
})
replace(/(color|background):(\w+)/g, function(match, property, colorName) { // replace standard colors with hex values (only if color name is longer then hex value)
if (CleanCSS.colors[colorName]) return property + ':' + CleanCSS.colors[colorName];
'hex value to color name': [
'p{color:#f00}',
'p{color:red}'
+ ],
+ 'border color': [
+ 'p{border:1px solid #f94311}',
+ 'p{border:1px solid #f94311}'
]
}),
'font weights': cssContext({