Closed yangshun closed 5 years ago
Thanks for this awesome plugin! I have some questions regarding how the plugin deals with selectors of higher specificity.
I see that
.button { --button-background-color: red; color: var(--button-background-color); } .button:hover { --button-background-color: green; }
correctly becomes
.button { color: red; } .button:hover { color: green; }
because .button:hover is a pseudoclass of .button.
.button:hover
.button
But the following:
.button { --button-background-color: red; color: var(--button-background-color); } .button.button-primary { --button-background-color: green; }
produces just
.button { color: red; }
I was expecting the following because .button.button-primary is more specific than .button:
.button.button-primary
.button.button-primary { color: green; }
Is this a bug or is this intended? If it's a bug I could try sending a PR to fix it.
Duplicate of https://github.com/MadLittleMods/postcss-css-variables/issues/77
Thanks for this awesome plugin! I have some questions regarding how the plugin deals with selectors of higher specificity.
I see that
correctly becomes
because
.button:hover
is a pseudoclass of.button
.But the following:
produces just
I was expecting the following because
.button.button-primary
is more specific than.button
:Is this a bug or is this intended? If it's a bug I could try sending a PR to fix it.