-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Copy link
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling
Description
Describe the bug
I've got some complex sibling combinator + :has css selectors that match the DOM but are reported as unused by Svelte. Through further testing, it appears that some trivial cases are incorrectly marked as unused.
Reproduction
- Open
./packages/svelte/tests/css/samples/has/input.svelte - Add the following code to the bottom of the
styleblock
x:has(+ c) {
color: green;
}
x:has(~ c) {
color: green;
}
Notice that these are valid selectors based on the given DOM structure
- Run the test. It now fails with 2
css_unused_selectorerrors. I've found that wrappingcin:global()seems to get rid of the errors, but I'm not sure if that should be required to get this selector working.
Logs
No response
System Info
Svelte Version - 5.1.6Severity
annoyance
kling90 and sted
Metadata
Metadata
Assignees
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling