+[3.1.1 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.0...HEAD)
+==================
+
+* Fixed issue [#470](https://github.com/jakubpawlowicz/clean-css/issues/470) - negative padding removal.
+
[3.1.0 / 2015-02-26](https://github.com/jakubpawlowicz/clean-css/compare/v3.0.10...3.1.0)
==================
}
};
+function isNegative(value) {
+ var parts = new Splitter(',').split(value);
+ for (var i = 0, l = parts.length; i < l; i++) {
+ if (parts[i][0] == '-' && parseFloat(parts[i]) < 0)
+ return true;
+ }
+
+ return false;
+}
+
function zeroMinifier(_, value) {
if (value.indexOf('0') == -1)
return value;
important = true;
}
+ if (property.indexOf('padding') === 0 && isNegative(value))
+ continue;
+
if (property.indexOf('border') === 0 && property.indexOf('radius') > 0)
value = valueMinifiers['border-*-radius'](value);
'div{padding:10em .05rem}'
]
}),
+ 'units': cssContext({
+ 'negative padding': [
+ 'div{padding-left:2px;padding-top:-2px;padding-right:5px;padding-bottom:0}',
+ 'div{padding-left:2px;padding-right:5px;padding-bottom:0}'
+ ],
+ 'negative padding after negative shorthand': [
+ 'div{padding:-5px 0 0 0;padding-left:2px;padding-top:-2px;padding-right:5px;padding-bottom:0}',
+ 'div{padding-left:2px;padding-right:5px;padding-bottom:0}'
+ ],
+ 'negative padding in calculations': [
+ 'div{padding:calc(100% - 5px) 0 0 0}',
+ 'div{padding:calc(100% - 5px)0 0}'
+ ]
+ }),
'floats': cssContext({
'strips zero in fractions': [
'a{ margin-bottom: 0.5em}',