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

The css :has selector is broken #13812

Closed
enyo opened this issue Oct 23, 2024 · 1 comment
Closed

The css :has selector is broken #13812

enyo opened this issue Oct 23, 2024 · 1 comment

Comments

@enyo
Copy link

enyo commented Oct 23, 2024

Describe the bug

When using nesting inside a :has() selector, svelte doesn't recognize the children and removes the selector.

Example:

article:has(a:hover) {
  /* This works */
  background: yellow;

  a {
    /* This does not, it gets removed with a (unused) note */
    color: red;
  }
}

A workaround is to use global:

article:has(a:hover) {
  /* This works */
  background: yellow;

  :global(a) {
    /* This works */
    color: red;
  }
}

Reproduction

https://svelte.dev/playground/23060df7688c4bb1be84023e56f00996?version=5.0.5

System Info

This issue appeared in 5.0.0-next.266. It still works fine in 5.0.0-next.265.

Severity

annoyance

@brunnerh
Copy link
Member

Probably a duplicate of:

@enyo enyo closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants