Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS attribute selectors not being removed #110

Closed
davidhouweling opened this issue Jul 21, 2018 · 3 comments
Closed

CSS attribute selectors not being removed #110

davidhouweling opened this issue Jul 21, 2018 · 3 comments

Comments

@davidhouweling
Copy link

davidhouweling commented Jul 21, 2018

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

  1. Using the following HTML
<html>
  <body>
    <div class="component"></div>
  </body>
</html>
  1. With the following CSS
.component { color: black; }
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}
  1. Passing the above HTML and CSS through the CLI
  2. 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
Copy link
Collaborator

At the moment purgecss only works with basic selectors like id, class and tag because of limitations in the extractors.

@michaelx
Copy link

Sorry to bother, but any ETA on this one?

@leeoniya
Copy link

leeoniya commented Mar 22, 2019

if anyone's interested, i made an alternative css cleanser that handles this (and many other issues) properly.

https://github.com/leeoniya/dropcss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Next
  
Done
Development

No branches or pull requests

5 participants