[4.0.9 / 2017-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.8...4.0)
==================
+* Fixed issue [#907](https://github.com/jakubpawlowicz/clean-css/issues/907) - space after closing brace in `@supports`.
* Fixed issue [#910](https://github.com/jakubpawlowicz/clean-css/issues/910) - too aggressive precision optimizations.
[4.0.8 / 2017-02-22](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.7...v4.0.8)
+var SUPPORTED_COMPACT_BLOCK_MATCHER = /^@media\W/;
+
function tidyBlock(values, spaceAfterClosingBrace) {
+ var withoutSpaceAfterClosingBrace;
var i;
for (i = values.length - 1; i >= 0; i--) {
+ withoutSpaceAfterClosingBrace = !spaceAfterClosingBrace && SUPPORTED_COMPACT_BLOCK_MATCHER.test(values[i][1]);
+
values[i][1] = values[i][1]
.replace(/\n|\r\n/g, ' ')
.replace(/\s+/g, ' ')
.replace(/ \)/g, ')')
.replace(/'([a-zA-Z][a-zA-Z\d\-_]+)'/, '$1')
.replace(/"([a-zA-Z][a-zA-Z\d\-_]+)"/, '$1')
- .replace(spaceAfterClosingBrace ? null : /\) /g, ')');
+ .replace(withoutSpaceAfterClosingBrace ? /\) /g : null, ')');
}
return values;
]
}, { level: { 1: { tidyBlockScopes: false } } })
)
+ .addBatch(
+ optimizerContext('tidy block space after closing brace', {
+ 'removes space in @media': [
+ '@media (min-width:50px) and print{.block{color:red}}',
+ '@media (min-width:50px)and print{.block{color:red}}'
+ ],
+ 'keeps space in @supports': [
+ '@supports (filter:blur(1px)) or (-webkit-filter:blur(1px)){.block{color:red}}',
+ '@supports (filter:blur(1px)) or (-webkit-filter:blur(1px)){.block{color:red}}'
+ ]
+ }, { compatibility: { properties: { spaceAfterClosingBrace: false } }, level: 1 })
+ )
.addBatch(
optimizerContext('tidy block scopes optimizations off', {
'stays as it is': [