-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly prune CSS for elements inside snippets (#14494)
fixes #14483
- Loading branch information
1 parent
99b4cfb
commit 1f25bd4
Showing
5 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: correctly prune CSS for elements inside snippets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
div div.svelte-xyz { | ||
div.svelte-xyz div:where(.svelte-xyz) { | ||
color: green; | ||
} | ||
/* (unused) div + div { | ||
|
4 changes: 4 additions & 0 deletions
4
packages/svelte/tests/css/samples/snippets-elements/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
x.svelte-xyz y:where(.svelte-xyz) { | ||
color: green; | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/css/samples/snippets-elements/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{#snippet foo()} | ||
<x> | ||
<y></y> | ||
</x> | ||
{/snippet} | ||
|
||
{@render foo()} | ||
|
||
<style> | ||
x y { | ||
color: green; | ||
} | ||
</style> |