You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a CSS rule contains a colon that is escaped with a backslash (which is how sass emits them by default, I'm not trying to push on stuff here), then purgecss will not include that rule in the output even if it should be included.
To Reproduce
CSS file c.css (reduced from how sass compiles my stylesheets):
I found this when I was seeing layout problems in my site which uses USWDS; sass compiles its layout rules down to rules with escaped colons in the name, and purgecss was incorrectly removing them.
It seems to be the expected behavior. You would need to specify another "extractor" to be able to handle semicolon. Take a look at the documentation here: https://purgecss.com/extractors.html
Describe the bug
If a CSS rule contains a colon that is escaped with a backslash (which is how sass emits them by default, I'm not trying to push on stuff here), then purgecss will not include that rule in the output even if it should be included.
To Reproduce
CSS file
c.css
(reduced from how sass compiles my stylesheets):html file
index.html
:test output:
If you remove the backslash escaping the colon, it works as expected.
d.css
:works as expected:
Expected Behavior
I expect purgecss to recognize that
.tablet\:grid-col-6
is a class name with an escaped colon, and handle it as such.It seems that purgecss is parsing the backslash as a literal backslash in the name instead of as an escape:
Environment
macos ventura, node v19.4.0, purgecss 4.1.3
Add any other context about the problem here
I found this when I was seeing layout problems in my site which uses USWDS; sass compiles its layout rules down to rules with escaped colons in the name, and purgecss was incorrectly removing them.
Possibly related to #978
Code of Conduct
The text was updated successfully, but these errors were encountered: