-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
False positive "Unused CSS selector" on :global():has() #14910
Comments
I am facing the same issue, when migrating our codebase from Svelte 4 to Svelte 5. Because of the size of our codebase, the severity of this issue exceeds annoyance for us. It prevents us from upgrading all together. I only upgraded the svelte version, I did not converted anything to runes just yet. |
That looks correct to me: the App component doesn't have any - div :global(.card-list) {
+ div :global .card-list { or wrapping |
Ow wauw, I completely missed the |
Fixes #14910 The issue occurs only when :has() targets at a component's root element and because include_self is false. I came to the conclusion that this is the same case as :root:has(.scoped).
Describe the bug
Selector like
:global(.parent):has(.component)
, which points to an external element but also refers to a component's one, is marked as unused.Reproduction
Example version 5.16.2
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: