* Removes `debug` API switch as stats are always gathered and available under `stats` property.
* Replaces the old tokenizer with a new one which doesn't use any escaping.
* Replaces the old `@import` inlining with one on top of the new tokenizer.
+* Re-enables `background-(clip|origin|size)` merging with `background` shorthand.
* Simplifies URL rebasing with a single `rebaseTo` option in API or inferred from `--output` in CLI.
* Splits `inliner` option into `inlineRequest` and `inlineTimeout`.
* Fixed issue [#209](https://github.com/jakubpawlowicz/clean-css/issues/209) - adds output formatting via `beautify` flag.
opacity: true // rgba / hsla
},
properties: {
- backgroundClipMerging: false, // background-clip to shorthand
- backgroundOriginMerging: false, // background-origin to shorthand
- backgroundSizeMerging: false, // background-size to shorthand
+ backgroundClipMerging: true, // background-clip to shorthand
+ backgroundOriginMerging: true, // background-origin to shorthand
+ backgroundSizeMerging: true, // background-size to shorthand
colors: true, // any kind of color transformations, like `#ff00ff` to `#f0f` or `#fff` into `red`
fontWeight: true, // normal -> '400'
ieBangHack: false, // !ie suffix hacks on IE<8
opacity: false
},
properties: {
+ backgroundClipMerging: false,
+ backgroundOriginMerging: false,
+ backgroundSizeMerging: false,
iePrefixHack: true,
merging: false
},
-.envelope{background:url(test/fixtures/one.png) top center repeat-x,url(test/fixtures/one.png) bottom center repeat-x,url(test/fixtures/two.png) 110% 10px no-repeat #eee;background-size:35px 4px,35px 4px,101px 61px}
\ No newline at end of file
+.envelope{background:url(test/fixtures/one.png) top center/35px 4px repeat-x,url(test/fixtures/one.png) bottom center/35px 4px repeat-x,url(test/fixtures/two.png) 110% 10px/101px 61px no-repeat #eee}
\ No newline at end of file
],
'with background-size property': [
'a{background:none;background-image:url(1.png);background-size:28px 28px}',
- 'a{background:url(1.png);background-size:28px 28px}'
+ 'a{background:url(1.png) 0 0/28px 28px}'
]
})
)
],
'over a property in the same selector': [
'div{background-size:100%}a{background:no-repeat;background-size:100%}',
- 'div{background-size:100%}a{background:no-repeat;background-size:100%}'
+ 'div{background-size:100%}a{background:0 0/100% no-repeat}'
],
'multiple granular up to a shorthand': [
'.one{border:1px solid #bbb}.two{border-color:#666}.three{border-width:1px;border-style:solid}',
]
]);
}
+ },
+ 'background-clip, -origin, and -size': {
+ 'topic': function () {
+ return _optimize('a{background:url(/image.png);background-size:10px;background-origin:border-box;background-clip:padding-box}');
+ },
+ 'into': function (properties) {
+ assert.deepEqual(properties, [
+ [
+ 'property',
+ ['property-name', 'background', [[1, 2, undefined]]],
+ ['property-value', 'url(/image.png)', [[1, 13, undefined]]],
+ ['property-value', 0],
+ ['property-value', 0],
+ ['property-value', '/'],
+ ['property-value', '10px', [[1, 45, undefined]]],
+ ['property-value', 'border-box', [[1, 68, undefined]]],
+ ['property-value', 'padding-box', [[1, 95, undefined]]]
+ ]
+ ]);
+ }
+ },
+ 'background-clip, -origin, and -size - IE8 compatibility mode': {
+ 'topic': function () {
+ return _optimize('a{background:url(/image.png);background-size:10px;background-origin:border-box;background-clip:padding-box}', 'ie8');
+ },
+ 'into': function (properties) {
+ assert.deepEqual(properties, [
+ [
+ 'property',
+ ['property-name', 'background', [[1, 2, undefined]]],
+ ['property-value', 'url(/image.png)', [[1, 13, undefined]]]
+ ],
+ [
+ 'property',
+ ['property-name', 'background-size', [[1, 29, undefined]]],
+ ['property-value', '10px', [[1, 45, undefined]]]
+ ],
+ [
+ 'property',
+ ['property-name', 'background-origin', [[1, 50, undefined]]],
+ ['property-value', 'border-box', [[1, 68, undefined]]]
+ ],
+ [
+ 'property',
+ ['property-name', 'background-clip', [[1, 79, undefined]]],
+ ['property-value', 'padding-box', [[1, 95, undefined]]]
+ ]
+ ]);
+ }
}
})
.addBatch({
'gets default compatibility': function (compat) {
assert.isTrue(compat.colors.opacity);
assert.isTrue(compat.properties.colors);
- assert.isFalse(compat.properties.backgroundClipMerging);
- assert.isFalse(compat.properties.backgroundOriginMerging);
- assert.isFalse(compat.properties.backgroundSizeMerging);
+ assert.isTrue(compat.properties.backgroundClipMerging);
+ assert.isTrue(compat.properties.backgroundOriginMerging);
+ assert.isTrue(compat.properties.backgroundSizeMerging);
assert.isTrue(compat.properties.fontWeight);
assert.isFalse(compat.properties.ieBangHack);
assert.isFalse(compat.properties.iePrefixHack);
},
'gets merged compatibility': function (compat) {
assert.isTrue(compat.colors.opacity);
- assert.isFalse(compat.properties.backgroundClipMerging);
- assert.isFalse(compat.properties.backgroundOriginMerging);
- assert.isFalse(compat.properties.backgroundSizeMerging);
+ assert.isTrue(compat.properties.backgroundClipMerging);
+ assert.isTrue(compat.properties.backgroundOriginMerging);
+ assert.isTrue(compat.properties.backgroundSizeMerging);
assert.isTrue(compat.properties.colors);
assert.isFalse(compat.properties.ieBangHack);
assert.isFalse(compat.properties.iePrefixHack);
},
'gets template compatibility': function (compat) {
assert.isTrue(compat.colors.opacity);
- assert.isFalse(compat.properties.backgroundClipMerging);
- assert.isFalse(compat.properties.backgroundOriginMerging);
- assert.isFalse(compat.properties.backgroundSizeMerging);
+ assert.isTrue(compat.properties.backgroundClipMerging);
+ assert.isTrue(compat.properties.backgroundOriginMerging);
+ assert.isTrue(compat.properties.backgroundSizeMerging);
assert.isTrue(compat.properties.colors);
assert.isTrue(compat.properties.fontWeight);
assert.isFalse(compat.properties.ieBangHack);
'gets calculated compatibility': function (compat) {
assert.isTrue(compat.colors.opacity);
assert.isTrue(compat.properties.colors);
- assert.isFalse(compat.properties.backgroundClipMerging);
- assert.isFalse(compat.properties.backgroundOriginMerging);
- assert.isFalse(compat.properties.backgroundSizeMerging);
+ assert.isTrue(compat.properties.backgroundClipMerging);
+ assert.isTrue(compat.properties.backgroundOriginMerging);
+ assert.isTrue(compat.properties.backgroundSizeMerging);
assert.isFalse(compat.properties.ieBangHack);
assert.isTrue(compat.properties.iePrefixHack);
assert.isFalse(compat.properties.ieSuffixHack);
'gets calculated compatibility': function (compat) {
assert.isTrue(compat.colors.opacity);
assert.isTrue(compat.properties.colors);
- assert.isFalse(compat.properties.backgroundClipMerging);
- assert.isFalse(compat.properties.backgroundOriginMerging);
- assert.isFalse(compat.properties.backgroundSizeMerging);
+ assert.isTrue(compat.properties.backgroundClipMerging);
+ assert.isTrue(compat.properties.backgroundOriginMerging);
+ assert.isTrue(compat.properties.backgroundSizeMerging);
assert.isFalse(compat.properties.ieBangHack);
assert.isTrue(compat.properties.iePrefixHack);
assert.isFalse(compat.properties.ieSuffixHack);