E.g 040px can be safely turned into 40px.
* Fixed issue [#186](https://github.com/GoalSmashers/clean-css/issues/186) - strip unit from 0rem.
* Fixed issue [#207](https://github.com/GoalSmashers/clean-css/issues/207) - bug in parsing protocol `@import`s.
* Fixed issue [#213](https://github.com/GoalSmashers/clean-css/issues/213) - faster rgb to hex transforms.
+* Fixed issue [#215](https://github.com/GoalSmashers/clean-css/issues/215) - leading zeros in numerical values.
* Fixed issue [#217](https://github.com/GoalSmashers/clean-css/issues/217) - whitespace inside attribute selectors and urls.
* Fixed issue [#218](https://github.com/GoalSmashers/clean-css/issues/218) - `@import` statements cleanup.
* Fixed issue [#220](https://github.com/GoalSmashers/clean-css/issues/220) - selector between comments.
replace(new RegExp('(\\s|:|,)0(?:' + units.join('|') + ')', 'g'), '$1' + '0');
replace(new RegExp('rect\\(0(?:' + units.join('|') + ')', 'g'), 'rect(0');
+ // zero(s) + value to value
+ replace(/(\s|:|,)0+([1-9])/g, '$1$2');
+
// round pixels to 2nd decimal place
replace(/\.(\d{3,})px/g, function(match, decimalPlaces) {
return '.' + Math.round(parseFloat('.' + decimalPlaces) * 100) + 'px';
'fractions': [
'div{margin:.1em .1em .1em .1em}',
'div{margin:.1em}'
+ ],
+ 'preceeding value': [
+ 'div{padding:010px 00015px}',
+ 'div{padding:10px 15px}'
+ ],
+ 'preceeding value with fraction zeros': [
+ 'div{padding:010.0em .05rem}',
+ 'div{padding:10em .05rem}'
]
}),
'floats': cssContext({