Closed Fenntasy closed 6 years ago
Hey @Fenntasy, it does not replace --othercolor
because we don’t know that’s the correct variable to use:
<body class="myClass" id="myId">
#myId {
--othercolor: green;
}
.myClass {
--othercolor: blue;
background: var(--othercolor);
}
The background of <body>
will be green
.
Thanks.
overwrite variables cannot be fallback, /(ㄒoㄒ)/~~
Relevant thread: postcss/postcss-custom-properties#1
Hello,
I may be wrong in my interpretation of this plugin but I don't understand what it does when we use CSS custom properties outside of a
:root
definition.Here is a test file:
And here is the output:
I like that it keeps the use of
var(--color)
for browsers that can deal with it but just prefix it with a safe value. But I don't understand why it does not work with--othercolor
, especially when it duplicates the lines.Is there something I'm missing or is this a bug?