* Background positions with more than 2 components were treated incorrectly.
* Fixed issue [#373](https://github.com/GoalSmashers/clean-css/issues/373) - proper background shorthand merging.
* Fixed issue [#395](https://github.com/GoalSmashers/clean-css/issues/395) - unescaped brackets in data URIs.
* Fixed issue [#403](https://github.com/GoalSmashers/clean-css/issues/403) - tracking input files in source maps.
+* Refixed issue [#304](https://github.com/GoalSmashers/clean-css/issues/304) - background position merging.
[2.2.19 / 2014-11-20](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.18...v2.2.19)
==================
var repeat = result[3];
var attachment = result[4];
var color = result[5];
+ var positionSet = false;
// Take care of inherit
if (token.value === 'inherit') {
i -= 2;
} else if (parts[i - 1] == '/') {
size.value = currentPart;
- position.value = previousPart;
- i--;
} else {
- position.value = previousPart + ' ' + currentPart;
- i--;
+ position.value = currentPart + (positionSet ? ' ' + position.value : '');
+ positionSet = true;
}
} else {
- position.value = currentPart;
+ position.value = currentPart + (positionSet ? ' ' + position.value : '');
+ positionSet = true;
}
} else if (validator.isValidBackgroundPositionAndSize(currentPart)) {
var sizeValue = new Splitter('/').split(currentPart);
--- /dev/null
+.one{background:url(one.png) right 10px top 10px no-repeat,linear-gradient(0deg,#efefef 0,#fff 100%)}
+.two{background:url(two.png) right 9px top 15px/9px 7px no-repeat,linear-gradient(-179deg,#FFF 0,#F9F9F9 100%)}
--- /dev/null
+.one {
+ background: url(one.png) no-repeat right 10px top 10px, linear-gradient(0deg, #efefef 0%, #ffffff 100%);
+}
+.two {
+ background: url(two.png) no-repeat right 9px top 15px/9px 7px, linear-gradient(-179deg, #FFFFFF 0%, #F9F9F9 100%);
+}
]
}),
'background size with -properties.backgroundSizeMerging': cssContext({
- 'standard': 'div{background:url(image.png) no-repeat center;background-size:cover}',
- 'prefix': 'div{-webkit-background:url(image.png) no-repeat center;-webkit-background-size:cover}'
+ 'standard': 'div{background:url(image.png) center no-repeat;background-size:cover}',
+ 'prefix': 'div{-webkit-background:url(image.png) center no-repeat;-webkit-background-size:cover}'
}, { compatibility: '-properties.backgroundSizeMerging' }),
'multiple backgrounds': cssContext({
'should not produce longer values': 'p{background:no-repeat;background-position:100% 0,0 100%,100% 100%,50% 50%}'