From 261d6f12a0375416e156e695cb02b25dcd940deb Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Mon, 11 Nov 2024 15:05:23 +0100 Subject: [PATCH] coindicentally this also fixes #14189 --- .changeset/great-bulldogs-wonder.md | 5 +++++ .../tests/css/samples/not-selector-global/expected.css | 9 +++++++++ .../tests/css/samples/not-selector-global/input.svelte | 9 +++++++++ 3 files changed, 23 insertions(+) create mode 100644 .changeset/great-bulldogs-wonder.md diff --git a/.changeset/great-bulldogs-wonder.md b/.changeset/great-bulldogs-wonder.md new file mode 100644 index 0000000000..b6cafa4585 --- /dev/null +++ b/.changeset/great-bulldogs-wonder.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: prevent nested pseudo class from being marked as unused diff --git a/packages/svelte/tests/css/samples/not-selector-global/expected.css b/packages/svelte/tests/css/samples/not-selector-global/expected.css index ea9ff39486..b815dcf9aa 100644 --- a/packages/svelte/tests/css/samples/not-selector-global/expected.css +++ b/packages/svelte/tests/css/samples/not-selector-global/expected.css @@ -27,3 +27,12 @@ span:not(p span) { color: green; } + + .x { + .svelte-xyz:not(.foo) { + color: green; + } + &:not(.foo) { + color: green; + } + } diff --git a/packages/svelte/tests/css/samples/not-selector-global/input.svelte b/packages/svelte/tests/css/samples/not-selector-global/input.svelte index 1f0e6cd6db..1d2f7a9bca 100644 --- a/packages/svelte/tests/css/samples/not-selector-global/input.svelte +++ b/packages/svelte/tests/css/samples/not-selector-global/input.svelte @@ -34,4 +34,13 @@ :global(span:not(p span)) { color: green; } + + :global(.x) { + :not(.foo) { + color: green; + } + &:not(.foo) { + color: green; + } + } \ No newline at end of file