MadLittleMods / postcss-css-variables

PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation
https://madlittlemods.github.io/postcss-css-variables/playground/
Other
536 stars 62 forks source link

Not completely normal work in the group selector #28

Closed fsy0718 closed 8 years ago

fsy0718 commented 8 years ago
:root{--color: red};
.test1,.test2{color: var(--color)};

this plugin output:

.test1{color: red;}
.test2{color: red}

but the postcss-custom-properties output:

.test1,.test2{color:red;}
MadLittleMods commented 8 years ago

The output CSS is equivalent and while it could be compressed back down, I'd rather leave it as is. This could change after the refactor.

Consider the following on why we do split it out always:

.foo {
  --some-color: #f00;
}
.bar {
  --some-color: #0f0;
}

.foo, .bar {
  color: var(--some-color);
}