postcss / postcss-custom-properties

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

Preserving css variables #87

Closed djmtype closed 6 years ago

djmtype commented 6 years ago

Maybe I'm declaring this wrong, my custom variables are being processed via cssnext, but I want them preserved as is.

Part of my gulp task:

cssnext({
  customProperties: ['preserve: true']
})

In other words…

:root {
  --mainColor: #333;
}

body {
  color: var(--mainColor);
}

…should return exactly that, NOT:

body {
  color: #333
}