postcss / postcss-custom-properties

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

Can't overwrite options.variables locally #124

Closed tyler-dot-earth closed 5 years ago

tyler-dot-earth commented 6 years ago

Given something like:

        'custom-properties': {
          appendVariables: true,
          warnings: true,
          variables: { brand: 'blue' },
        },

I cannot do this in a css file:

:root {
  --brand: 'red';
}

div {
  color: var(--brand);
}

The div will still effectively be color: blue because variables are appended, not prepended (and dont work unless appended?)

Is this expected behavior? Is there ways around this that I'm not understanding?


FWIW here's how I'm getting around this right now:

  1. disable custom-properties
  2. use postcss-css-variables instead