postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
597 stars 77 forks source link

root containing comments is preserved with preserve: false #123

Closed gpoitch closed 5 years ago

gpoitch commented 6 years ago
postCSSCustomProperties({
  preserve: false
})
:root {
  /* Colors */
  --color: red;
}

h1 {
  color: var(--color);
}

/* becomes */

:root {
  /* Colors */
}

h1 {
  color: red;
}
jonathantneal commented 5 years ago

It cannot be safely inferred whether comments in :root or html would be related to custom properties. This should be handled by a minifier.