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]: :has() and double descendant selector is falsely purged #1215

Open
1 task done
SteveOverSea opened this issue Feb 5, 2024 · 0 comments
Open
1 task done

[Bug]: :has() and double descendant selector is falsely purged #1215

SteveOverSea opened this issue Feb 5, 2024 · 0 comments
Labels

Comments

@SteveOverSea
Copy link

Describe the bug

When using a selector like

body:has(.green) .conditional-red p {
    color: red;
}

The selector is purged even though the styles clearly would apply to an element.

To Reproduce

I recreated the issue in a minimal setup in the attached zip file.

Basically it is enough to just write a <any1>:has(<any2>) <any3> <any4> selector and provide an html like

<any1>
    <any2></any2>
    <any3>
        <any4></any4>
    </any3>
</any1>

Expected Behavior

The selector should not be purged when the styles actually are applied

Environment

macOS 14.2.1 (23C71)
purgecss: 5.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
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

1 participant