Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: take snippets into account when scoping css selectors
fixes #10143
- Loading branch information
1 parent
c7a7725
commit 96f432d
Showing
5 changed files
with
98 additions
and
10 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: take snippets into account when scoping css selectors |
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
16 changes: 16 additions & 0 deletions
16
packages/svelte/tests/css/samples/descendant-selectors-render-tag/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,16 @@ | ||
|
||
div.svelte-xyz > span.svelte-xyz { | ||
background-color: red; | ||
} | ||
|
||
div.svelte-xyz span.svelte-xyz { | ||
letter-spacing: 10px; | ||
} | ||
|
||
div.svelte-xyz span { | ||
text-decoration: underline; | ||
} | ||
|
||
p.svelte-xyz span.svelte-xyz.svelte-xyz { | ||
background: black; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/svelte/tests/css/samples/descendant-selectors-render-tag/expected.html
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,2 @@ | ||
<div class="svelte-xyz"><span class="svelte-xyz">Hello world</span></div> | ||
<p class="svelte-xyz"><strong><span class="svelte-xyz">Hello world</span></strong></p> |
31 changes: 31 additions & 0 deletions
31
packages/svelte/tests/css/samples/descendant-selectors-render-tag/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,31 @@ | ||
{#snippet my_snippet()} | ||
<span>Hello world</span> | ||
{/snippet} | ||
|
||
<div>{@render my_snippet()}</div> | ||
|
||
<p> | ||
{#snippet my_snippet()} | ||
<span>Hello world</span> | ||
{/snippet} | ||
|
||
<strong>{@render my_snippet()}</strong> | ||
</p> | ||
|
||
<style> | ||
div > span { | ||
background-color: red; | ||
} | ||
div span { | ||
letter-spacing: 10px; | ||
} | ||
div :global(span) { | ||
text-decoration: underline; | ||
} | ||
p span { | ||
background: black; | ||
} | ||
</style> |