postcss-custom-properties: removing duplicate rules #1396
|
Hi there, I have a question about duplicate values. As the docs say: :root {
--text-color: var(--color-pink);
}
div {
color: var(--text-color);
}
/* becomes */
:root {
--text-color: var(--color-pink);
}
div {
color: rgb(255, 192, 211);
color: var(--text-color);
}How can I remove :root {
--text-color: var(--color-pink);
}
div {
color: rgb(255, 192, 211);
}I need to inline that CSS and because the rule with the CSS variable is last, I get this: <div style="color: var(--text-color)">When in fact I need it to use the value that was resolved: <div style="color: rgb(255, 192, 211)">Thanks! |
Answered by
romainmenke
May 16, 2024
Replies: 1 comment 5 replies
|
Hi @cossssmin,
It is not intended to "resolve" all variables. Maybe a tool like Sass is a better fit for this? There is the |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You setup has too many other parts that are not maintained by us for us to help you with this :)
But I can say :
preserve: false:postcssCustomProperties({ preserve: false }),