postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
597 stars 77 forks source link

Resolve :root variables when combined with class definitions #224

Open blvdmitry opened 3 years ago

blvdmitry commented 3 years ago

I've seen a couple of issues about resolving variables attached to specific classes and that's true indeed that it's impossible to resolve nesting cases in build time. My use case is a bit different from this, but similar topic:

:root, .foo {
  --color-red: red;
}

Couldn't make this definition work in the build time even for :root, while it should be possible to resolve at least that part in the build time.