postcss/postcss-custom-properties

Do not replace when a CSS variable is declared as alias of an other variable

Closed this issue · 1 comments

I have declared a variable who is like an alias of another variable:

:root {
  --normal-text-color: #0c0c0c;
  --widget-text-color: var(--normal-text-color);
}

With preserve: true, it becomes:

:root {
  --normal-text-color: #0c0c0c;
  --widget-text-color: #0c0c0c;  /* This is useless! */ 
  --widget-text-color: var(--normal-text-color);
}

You should exclude replacement from the :root selector or if variable is declared with the assignment of another CSS Variable.

Sorry; NPM downloaded version 0.4.0 ...