Skip to content

[Bug]: Selector that never matches not removedΒ #1323

@hvenev

Description

@hvenev

Describe the bug

A CSS selector that only uses classes/tags/ids that occur in the content, but never matches, is not removed.

Example HTML:

<div class="div">div</div>
<span class="span">span</span>

CSS:

div.span {
	color: #f00;
}

To Reproduce

  1. Copy the HTML and CSS from the example above.
  2. Invoke purgecss
  3. Observe that it does not purge the CSS

Expected Behavior

The CSS ruleset does not match anything and should therefore be removed.

Environment

purgecss version 6.0.0

Add any other context about the problem here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions