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

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

Open
1 task done
hvenev opened this issue Feb 5, 2025 · 1 comment
Open
1 task done

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

hvenev opened this issue Feb 5, 2025 · 1 comment
Labels

Comments

@hvenev
Copy link

hvenev commented Feb 5, 2025

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
@hvenev hvenev added the bug label Feb 5, 2025
@ehellman
Copy link

ehellman commented Feb 9, 2025

+1

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

No branches or pull requests

2 participants