* Fixes remote asset rebasing when passing data as a hash.
* Improves path resolution inside source maps.
* Makes `root` option implicitely default to `process.cwd()`.
+* Fixed issue [#371](https://github.com/jakubpawlowicz/clean-css/issues/371) - `background` fallback with `none`.
* Fixed issue [#376](https://github.com/jakubpawlowicz/clean-css/issues/376) - option to disable `0[unit]` -> `0`.
* Fixed issue [#396](https://github.com/jakubpawlowicz/clean-css/issues/396) - better input source maps tracking.
* Fixed issue [#397](https://github.com/jakubpawlowicz/clean-css/issues/397) - support for source map sources.
return property.name in compactable;
}
+function noneOverrideHack(left, right) {
+ return !left.multiplex &&
+ (left.name == 'background' || left.name == 'background-image') &&
+ right.multiplex &&
+ (right.name == 'background' || right.name == 'background-image') &&
+ right.value[right.value.length - 1][0] == 'none';
+}
+
function compactOverrides(properties, compatibility, validator) {
var mayOverride, right, left, component;
var i, j, k;
if (hasInherit(right))
continue;
+ if (noneOverrideHack(left, right))
+ continue;
+
if (!left.shorthand && right.shorthand && isComponentOf(right, left)) {
// maybe `left` can be overridden by `right` which is a shorthand?
if (!right.important && left.important)
[['background', false , false], ['__ESCAPED_URL_CLEAN_CSS0__'], [','], ['__ESCAPED_URL_CLEAN_CSS1__'], ['red']],
]);
}
+ },
+ 'background then background - svg hack': {
+ 'topic': 'p{background:__ESCAPED_URL_CLEAN_CSS0__;background: __ESCAPED_URL_CLEAN_CSS1__,none}',
+ 'into': function (topic) {
+ assert.deepEqual(_optimize(topic), [
+ [['background', false , false], ['__ESCAPED_URL_CLEAN_CSS0__']],
+ [['background', false , false], ['__ESCAPED_URL_CLEAN_CSS1__'], [','], ['none']]
+ ]);
+ }
+ },
+ 'background-image then background-image - svg hack': {
+ 'topic': 'p{background-image:__ESCAPED_URL_CLEAN_CSS0__;background-image: __ESCAPED_URL_CLEAN_CSS1__,none}',
+ 'into': function (topic) {
+ assert.deepEqual(_optimize(topic), [
+ [['background-image', false , false], ['__ESCAPED_URL_CLEAN_CSS0__']],
+ [['background-image', false , false], ['__ESCAPED_URL_CLEAN_CSS1__'], [','], ['none']]
+ ]);
+ }
}
})
.addBatch({