* Requires Node.js 4.0+ to run.
+[3.4.14 / 2016-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.13...3.4)
+==================
+
+* Fixed issue [#751](https://github.com/jakubpawlowicz/clean-css/issues/751) - stringifying CSS variables.
+
[3.4.13 / 2016-05-23](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.12...v3.4.13)
==================
var store = context.store;
var token = tokens[position];
var isVariableDeclaration = token[0][0].indexOf('--') === 0;
+ var isBlockVariable = isVariableDeclaration && Array.isArray(token[1][0]);
- if (isVariableDeclaration && atRulesOrProperties(token[1])) {
+ if (isVariableDeclaration && isBlockVariable && atRulesOrProperties(token[1])) {
store('{', context);
body(token[1], context);
store('};', context);
'gets right output': function (minified) {
assert.equal(minified.styles, '@font-face{font-family:si}a{font-family:si!important}');
}
+ },
+ 'variables': {
+ 'topic': function () {
+ return new CleanCSS({ sourceMap: true }).minify(':root{--color:red}');
+ },
+ 'gets right output': function (minified) {
+ assert.equal(minified.styles, ':root{--color:red}');
+ }
+ },
+ 'variables reused': {
+ 'topic': function () {
+ return new CleanCSS({ sourceMap: true }).minify(':root{--color:var(--otherColor)}');
+ },
+ 'gets right output': function (minified) {
+ assert.equal(minified.styles, ':root{--color:var(--otherColor)}');
+ }
}
})
.addBatch({
]
]
],
+ 'variable declarations': [
+ ':root{--color:var(--otherColor)}',
+ [
+ [
+ 'selector',
+ [[':root']],
+ [[['--color'], ['var(--otherColor)']]]
+ ]
+ ]
+ ],
'! important': [
'a{color:red! important}',
[