It's used as a hack so we should not optimize such expressions.
* Fixed issue [#500](https://github.com/jakubpawlowicz/clean-css/issues/500) - merging duplicate adjacent properties.
* Fixed issue [#507](https://github.com/jakubpawlowicz/clean-css/issues/507) - merging longhands into many shorthands.
* Fixed issue [#508](https://github.com/jakubpawlowicz/clean-css/issues/508) - removing duplicate media queries.
+* Fixed issue [#521](https://github.com/jakubpawlowicz/clean-css/issues/521) - unit optimizations inside `calc()`.
* Fixed issue [#526](https://github.com/jakubpawlowicz/clean-css/issues/526) - shorthand overriding into a function.
[3.1.9 / 2015-04-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.8...v3.1.9)
}
function unitMinifier(_, value, unitsRegexp) {
+ if (/^(?:\-moz\-calc|\-webkit\-calc|calc)\(/.test(value))
+ return value;
+
return value.replace(unitsRegexp, '$1' + '0');
}
'mixed vales': [
'a{padding:10px 0em 30% 0rem}',
[['padding', '10px', '0', '30%', '0']]
+ ],
+ 'inside calc': [
+ 'a{font-size:calc(100% + 0px)}',
+ [['font-size', 'calc(100% + 0px)']]
]
})
)