GoogleChromeLabs / postcss-jit-props

A CSS custom property helper based on PostCSS. Supply a pool of variables and this plugin will add them to the stylesheet as they are used.
https://stackblitz.com/edit/jit-open-props?file=postcss.config.js
Apache License 2.0
210 stars 9 forks source link

Optimization #16

Open argyleink opened 2 years ago

argyleink commented 2 years ago
:root {
  --red: red;
}

p {
  color: var(--blue);
}

should be:

:root {
  --red: red;
  --blue: blue;
}

p {
  color: var(--blue);
}

not:

:root {
  --red: red;
}

:root {
  --blue: blue;
}

p {
  color: var(--blue);
}