Skip to content

Svelte 5: Nested CSS does not work with the :has pseudo-selector. #13203

Closed
@Lofty-Brambles

Description

@Lofty-Brambles

Describe the bug

Svelte 5 (and most probably 4) seems to be unable to parse the & symbol within a :has pseudo-selector.
It throws a warning: Unused CSS selector "header:has(> &)".
It can be rewritten easily in the minimal reproduction provided; however, it is something that Svelte is unable to parse right now.

Reproduction

This is an example of a component with the aforementioned issue

Logs

No response

System Info

System:
    OS: Linux 5.10 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz
    Memory: 3.20 GB / 6.14 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 8.5.1 - ~/.local/share/pnpm/pnpm
  npmPackages:
    svelte: 5.0.0-next.244 => 5.0.0-next.244

Severity

annoyance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions