Skip to content

:has with sibling selector shows as unused when styling svg elements #14995

@wikoj1021

Description

@wikoj1021

Describe the bug

When trying to style elements based on siblings in :has selector is falsy reported as unused. When i wrap it in global it works.
When trying to style html elements in the same way it works without issues.

Reproduction

Logs

No response

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 18.77 GB / 31.11 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 18.20.3 - ~/.nvm/versions/node/v18.20.3/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.3/bin/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v18.20.3/bin/npm
    pnpm: 9.4.0 - ~/.nvm/versions/node/v18.20.3/bin/pnpm
    bun: 1.1.34 - ~/.bun/bin/bun
  Browsers:
    Chrome: 131.0.6778.264
  npmPackages:
    svelte: 5.17.3 => 5.17.3

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssStuff related to Svelte's built-in CSS handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions