replace(/([: ,\(])#f00/g, '$1red');
// replace font weight with numerical value
- replace(/font\-weight:(\w+)/g, function(match, weight) {
+ replace(/(font|font\-weight):(normal|bold)([ ;\}!])/g, function(match, property, weight, suffix) {
if (weight == 'normal')
- return 'font-weight:400';
+ return property + ':400' + suffix;
else if (weight == 'bold')
- return 'font-weight:700';
- else return match;
+ return property + ':700' + suffix;
+ else
+ return match;
});
// IE shorter filters but only if single (IE 7 issue)
'font-weight:bold to 700': [
'p{font-weight:bold}',
'p{font-weight:700}'
+ ],
+ 'font weight in font declarations': [
+ 'font:normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif',
+ 'font:400 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif'
+ ],
+ 'multiple changes': [
+ 'p{font-weight:bold;width:100%;font:normal}',
+ 'p{font-weight:700;width:100%;font:400}'
]
}),
'urls': cssContext({