postcss-css-variables icon indicating copy to clipboard operation
postcss-css-variables copied to clipboard

Use variable only from last pseudo-element

Open Zmoki opened this issue 9 years ago • 4 comments

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;
}

Zmoki avatar Nov 02 '16 12:11 Zmoki

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).

MadLittleMods avatar Nov 02 '16 20:11 MadLittleMods

Any updates on this bug ?

MrBaptastic avatar Jun 15 '17 01:06 MrBaptastic

Sorry, no updates @MrBaptastic

MadLittleMods avatar Jun 15 '17 04:06 MadLittleMods

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

joshgillies avatar Jun 19 '17 01:06 joshgillies