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
540 stars 62 forks source link

Use variable only from last pseudo-element #46

Open Zmoki opened 7 years ago

Zmoki commented 7 years ago

Input

.bar {
  --color: pink;
  color: var(--color);
}

.bar:active {
  --color: blue;
}

.bar:hover {
  --color: red;
}

.bar:focus {
  --color: green;
}

Expected

.bar {
  color: pink;
}

.bar:active {
  color: blue;
}

.bar:hover {
  color: red;
}

.bar:focus {
  color: green;
}

Will be transformed to (Actual)

😞

.bar {
  color: pink;
}

.bar:focus {
  color: green;
}

.bar:hover {
  color: green;
}

.bar:active {
  color: green;
}
MadLittleMods commented 7 years ago

Thanks for the report 😀 PR welcome, don't forget to add tests

For future reference, please also include your expected (I have edited in what I assume you expect).

MrBaptastic commented 7 years ago

Any updates on this bug ?

MadLittleMods commented 7 years ago

Sorry, no updates @MrBaptastic

joshgillies commented 7 years ago

@MadLittleMods any idea what would be required to resolve this issue?