CSS attribute selectors not being removed
davidhouweling opened this issue · 3 comments
davidhouweling commented
Describe the bug
As part of normalize.css, it uses attribute selectors as a means to select elements, however these get left in by purgecss.
To Reproduce
- Using the following HTML
<html>
<body>
<div class="component"></div>
</body>
</html>
- With the following CSS
.component { color: black; }
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
- Passing the above HTML and CSS through the CLI
- The resulting CSS is as followed
.component { color: black; }
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
Expected behavior
The generated CSS should be
.component { color: black; }
Screenshots
N/A
Desktop (please complete the following information):
- OS: Windows 10 version 1709
- Version of Purgecss 1.0.1
Additional context
N/A
jsnanigans commented
At the moment purgecss only works with basic selectors like id, class and tag because of limitations in the extractors.
michaelx commented
Sorry to bother, but any ETA on this one?
leeoniya commented
if anyone's interested, i made an alternative css cleanser that handles this (and many other issues) properly.