Skip to content

CSS attribute selectors not being removed #110

@davidhouweling

Description

@davidhouweling

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions