* It does not offer optimal minification by not handling 'font:normal normal normal <size> <font-family' case.
* Will be further improved to support mentioned case.
* Adds simplified and more advanced text escaping / restoring via EscapeStore class.
+1.1.2 / 2013-xx-xx (UNRELEASED)
+==================
+
+* Fixed issue [#149](https://github.com/GoalSmashers/clean-css/issues/149) - shorthand font property.
+
1.1.1 / 2013-09-07
==================
});
// replace font weight with numerical value
- replace(/(font|font\-weight):(normal|bold)([ ;\}!])/g, function(match, property, weight, suffix) {
+ replace(/(font\-weight|font):(normal|bold)([ ;\}!])(\w*)/g, function(match, property, weight, suffix, next) {
+ if (suffix == ' ' && next.length > 0 && !/[.\d]/.test(next))
+ return match;
+
if (weight == 'normal')
- return property + ':400' + suffix;
+ return property + ':400' + suffix + next;
else if (weight == 'bold')
- return property + ':700' + suffix;
+ return property + ':700' + suffix + next;
else
return match;
});
'font:normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif',
'font:400 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif'
],
+ 'font weight in font declarations with fraction units': [
+ 'font:bold .9rem Helvetica',
+ 'font:700 .9rem Helvetica'
+ ],
'multiple changes': [
- 'p{font-weight:bold;width:100%;font:normal}',
- 'p{font-weight:700;width:100%;font:400}'
- ]
+ 'p{font-weight:bold;width:100%;font:normal 12px Helvetica}',
+ 'p{font-weight:700;width:100%;font:400 12px Helvetica}'
+ ],
+ 'font weight in extended font declarations': 'font:normal normal normal 13px/20px Helvetica'
}),
'urls': cssContext({
'keep urls without parentheses unchanged': 'a{background:url(/images/blank.png) 0 0 no-repeat}',