+[2.2.6 / 2014-xx-xx](https://github.com/GoalSmashers/clean-css/compare/v2.2.5...v2.2.6)
+==================
+
+* Fixed issue [#311](https://github.com/GoalSmashers/clean-css/issues/311) - leading/trailing decimal points.
+
[2.2.5 / 2014-06-29](https://github.com/GoalSmashers/clean-css/compare/v2.2.4...v2.2.5)
==================
});
// .0 to 0
- replace(/(\D)\.0+(,|\}|\))/g, '$10$2');
+ // repeated twice on purpose as if not it doesn't process {padding: .0 .0 .0 .0} correctly
+ var leadingDecimalRegexp = /(\D)\.0+(\D)/g;
+ replace(leadingDecimalRegexp, '$10$2');
+ replace(leadingDecimalRegexp, '$10$2');
// fraction zeros removal
replace(/\.([1-9]*)0+(\D)/g, function(match, nonZeroPart, suffix) {
units.push('rem');
replace(new RegExp('(\\s|:|,)\\-?0(?:' + units.join('|') + ')', 'g'), '$1' + '0');
- replace(new RegExp('(\\s|:|,)\\-?(\\d)\\.(\\D)', 'g'), '$1$2$3');
+ replace(new RegExp('(\\s|:|,)\\-?(\\d+)\\.(\\D)', 'g'), '$1$2$3');
replace(new RegExp('rect\\(0(?:' + units.join('|') + ')', 'g'), 'rect(0');
// restore % in rgb/rgba and hsl/hsla
'body{margin:.0}',
'body{margin:0}'
],
+ 'zero as .0 #3': [
+ 'body{margin:.0em}',
+ 'body{margin:0}'
+ ],
+ 'zero as .0 #4': [
+ 'body{margin:.0 1em .0 .0}',
+ 'body{margin:0 1em 0 0}'
+ ],
'missing #1': [
'body{margin:2.em}',
'body{margin:2em}'
'p{opacity:1.}',
'p{opacity:1}'
],
+ 'missing #3': [
+ 'p{opacity:11.px}',
+ 'p{opacity:11px}'
+ ],
'minus zero as value to zero': [
'body{margin:-0}',
'body{margin:0}'