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

Improve compatibility with compound selectors #126

Open siilike opened 4 years ago

siilike commented 4 years ago

Fix #125 Fix #77 Fix #46 Fix #41

It's not perfect, but should be a significant improvement.

Also added special syntax for cases where explicit relations are not defined:

:root {
    --color: #000000;
}

body.bar * {
    --color: #ffffff;
}

#foo {
    color: var(--color);
}

which would output:

#foo {
    color: #000000;
}

body.bar #foo {
    color: #ffffff;
}
MadLittleMods commented 3 years ago

Thanks @siilike! Sorry for putting this off for so long. It would be good to have some review comments to describe the decisions and improvements but I understand it's been so long since you first implemented this.

It's great to see all of the new tests and existing tests still passing! I'll need to give this a slightly better look before merge.

siilike commented 3 years ago

I actually have to admit that I'm not using this plugin any more due to being able to drop IE11 support.

It was used in production and I cannot really remember any issues.

As it's been so long since I made the changes I know exactly as much as you on how and why they were made. : )

tomsommer commented 8 months ago

Can this be merged?