Properly handles cases when `background-color` is broken up in the
presence of source maps.
That happened because value array was coerced into a string which,
in presence of a source map, has also source info.
[3.3.8 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.6...3.3)
==================
+* Fixed issue [#629](https://github.com/jakubpawlowicz/clean-css/issues/629) - source maps & background shorthands.
* Fixed issue [#630](https://github.com/jakubpawlowicz/clean-css/issues/630) - vendor prefixed flex optimizations.
* Fixed issue [#633](https://github.com/jakubpawlowicz/clean-css/issues/633) - handling data URI with brackets.
// NOTE: we do this slicing as value may contain metadata too, like for source maps
size.value = [[sizeValue.pop()].concat(value.slice(1))];
position.value = [[sizeValue.pop()].concat(value.slice(1))];
- } else if ((color.value == compactable[color.name].defaultValue || color.value == 'none') && validator.isValidColor(value[0])) {
+ } else if ((color.value[0][0] == compactable[color.name].defaultValue || color.value[0][0] == 'none') && validator.isValidColor(value[0])) {
color.value = [value];
} else if (validator.isValidUrl(value[0]) || validator.isValidFunction(value[0])) {
image.value = [value];
assert.equal(minified.styles, 'a{background:linear-gradient(to bottom,rgba(0,0,0,.1) 0,rgba(0,0,0,.1))}');
}
},
+ 'background shorthand defaults': {
+ 'topic': function () {
+ return new CleanCSS({ sourceMap: true }).minify('a{background: #ffffff none repeat scroll 0 0}');
+ },
+ 'gets right output': function (minified) {
+ assert.equal(minified.styles, 'a{background:#fff}');
+ }
+ },
'important': {
'topic': function () {
return new CleanCSS({ sourceMap: true }).minify('@font-face{font-family:si}a{font-family:si!important}');