* Fixed issue [#360](https://github.com/GoalSmashers/clean-css/issues/360) - adds 7 extra CSS colors.
* Fixed issue [#363](https://github.com/GoalSmashers/clean-css/issues/363) - `rem` units overriding `px`.
+[2.2.17 / 2014-11-09](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.16...v2.2.17)
+==================
+
+* Fixed issue [#380](https://github.com/GoalSmashers/clean-css/issues/380) - rounding fractions to a whole number.
+
[2.2.16 / 2014-09-16](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.15...v2.2.16)
==================
return value
.replace(precisionOptions.regexp, function(match, decimalPlaces) {
var newFraction = Math.round(parseFloat('.' + decimalPlaces) * precisionOptions.multiplier) / precisionOptions.multiplier;
- return precisionOptions.value === 0 || newFraction === 0 ?
- 'px' :
- '.' + ('' + newFraction).substring('0.'.length) + 'px';
+ if (precisionOptions.value === 0 || newFraction === 0) {
+ return 'px';
+ } else {
+ return newFraction < 1 ?
+ '.' + ('' + newFraction).substring('0.'.length) + 'px' :
+ newFraction + 'px';
+ }
})
.replace(/(\d)\.($|\D)/g, '$1$2');
}
],
'do not round 2nd decimal place pixels': 'div{transform:translateY(20.55px)}',
'do not round percentages': 'div{left:20.505%}',
- 'do not round ems': 'div{font-size:1.505em}'
+ 'do not round ems': 'div{font-size:1.505em}',
+ 'rounds .9999 correctly': [
+ 'a{stroke-width:.99999px}',
+ 'a{stroke-width:1px}'
+ ]
}),
'floats custom rounding': cssContext({
'rounds to 4 values': [