-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CSS Variables Order #518
Comments
I have the same issue. I assume this is not fixed yea? or maybe I'm doing something wrong. |
I can confirm this happens in purgecss 4.1.3 as well. In case I try /* other declarations */
.foo {
.bar {
--some-var: 1;
@media (/*anything*/) {
--some-var: 2;
}
}
} I end up with @media (/*anything*/) {
.foo .bar {
--some-var: 2;
}
}
/* other declarations */
.foo .bar {
--some-var: 1;
} Instead of expected /* other declarations */
.foo .bar {
--some-var: 1;
}
@media (/*anything*/) {
.foo .bar {
--some-var: 2;
}
} But when I add something that won't change the semantics, like |
@jrencz your issue doesn't seem to be similar to this one. PurgeCSS wouldn't change the order of the rules. PostCSS is most likely the cause of this change. |
The case is that I'm not using postcss {
"scripts": {
"prod": "...",
"postprod": "purgecss --config ./purgecss.config.js"
}
} |
I've noticed that PurgeCSS removes variables even though they are used if they are not in "proper" order.
In this example the
--default
variable gets deleted since it is only defined after the--color
variable. If I put--default
before--color
everythign works.PurgeCSS v3.0.0
The text was updated successfully, but these errors were encountered: