-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use hybrid scoping strategy for consistent specificity increase (#…
…10443) * end the specificity wars * tweaks * document breaking change * blurgh --------- Co-authored-by: Rich Harris <[email protected]>
- Loading branch information
1 parent
5dd9951
commit 999fca9
Showing
51 changed files
with
314 additions
and
322 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: use hybrid scoping strategy for consistent specificity increase |
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
4 changes: 2 additions & 2 deletions
4
packages/svelte/tests/css/samples/child-combinator/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
main.svelte-xyz button.svelte-xyz.svelte-xyz { | ||
main.svelte-xyz button:where(.svelte-xyz) { | ||
background-color: red; | ||
} | ||
|
||
main.svelte-xyz div.svelte-xyz > button.svelte-xyz { | ||
main.svelte-xyz div:where(.svelte-xyz) > button:where(.svelte-xyz) { | ||
background-color: blue; | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/css/samples/combinator-child/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.test.svelte-xyz > div.svelte-xyz { | ||
.test.svelte-xyz > div:where(.svelte-xyz) { | ||
color: #0af; | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/css/samples/descendant-selector-non-top-level-outer/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
p.svelte-xyz span.svelte-xyz { | ||
p.svelte-xyz span:where(.svelte-xyz) { | ||
color: red; | ||
} |
12 changes: 6 additions & 6 deletions
12
packages/svelte/tests/css/samples/dynamic-element-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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
div.svelte-xyz.svelte-xyz.svelte-xyz { | ||
div.svelte-xyz { | ||
color: red; | ||
} | ||
h2.svelte-xyz > p.svelte-xyz.svelte-xyz { | ||
h2.svelte-xyz > p:where(.svelte-xyz) { | ||
color: red; | ||
} | ||
h2.svelte-xyz span.svelte-xyz.svelte-xyz { | ||
h2.svelte-xyz span:where(.svelte-xyz) { | ||
color: red; | ||
} | ||
h2.svelte-xyz > span.svelte-xyz > b.svelte-xyz { | ||
h2.svelte-xyz > span:where(.svelte-xyz) > b:where(.svelte-xyz) { | ||
color: red; | ||
} | ||
h2.svelte-xyz span b.svelte-xyz.svelte-xyz { | ||
h2.svelte-xyz span b:where(.svelte-xyz) { | ||
color: red; | ||
} | ||
h2.svelte-xyz b.svelte-xyz.svelte-xyz { | ||
h2.svelte-xyz b:where(.svelte-xyz) { | ||
color: red; | ||
} |
24 changes: 12 additions & 12 deletions
24
...es/svelte/tests/css/samples/general-siblings-combinator-await-not-exhaustive/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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
.a.svelte-xyz ~ .b.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .c.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .d.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .e.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .f.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .g.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .h.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .b:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .c:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .f:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .h:where(.svelte-xyz) { color: green; } | ||
|
||
.b.svelte-xyz ~ .d.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .d.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .e.svelte-xyz ~ .f.svelte-xyz ~ .h.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .d.svelte-xyz ~ .h.svelte-xyz.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .g.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.b.svelte-xyz ~ .e:where(.svelte-xyz) ~ .f:where(.svelte-xyz) ~ .h:where(.svelte-xyz) { color: green; } | ||
.b.svelte-xyz ~ .d:where(.svelte-xyz) ~ .h:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } |
14 changes: 7 additions & 7 deletions
14
packages/svelte/tests/css/samples/general-siblings-combinator-await/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
12 changes: 6 additions & 6 deletions
12
packages/svelte/tests/css/samples/general-siblings-combinator-each-2/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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
/* boundary of each */ | ||
.a.svelte-xyz ~ .b.svelte-xyz { | ||
.a.svelte-xyz ~ .b:where(.svelte-xyz) { | ||
color: green; | ||
} | ||
.c.svelte-xyz ~ .d.svelte-xyz { | ||
.c.svelte-xyz ~ .d:where(.svelte-xyz) { | ||
color: green; | ||
} | ||
/* if array is empty */ | ||
.a.svelte-xyz ~ .d.svelte-xyz { | ||
.a.svelte-xyz ~ .d:where(.svelte-xyz) { | ||
color: green; | ||
} | ||
/* if array has multiple items */ | ||
.c.svelte-xyz ~ .b.svelte-xyz { | ||
.c.svelte-xyz ~ .b:where(.svelte-xyz) { | ||
color: green; | ||
} | ||
/* normal sibling */ | ||
.b.svelte-xyz ~ .c.svelte-xyz { | ||
.b.svelte-xyz ~ .c:where(.svelte-xyz) { | ||
color: green; | ||
} | ||
.a.svelte-xyz ~ .c.svelte-xyz { | ||
.a.svelte-xyz ~ .c:where(.svelte-xyz) { | ||
color: green; | ||
} |
54 changes: 27 additions & 27 deletions
54
packages/svelte/tests/css/samples/general-siblings-combinator-each-else-nested/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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
.a.svelte-xyz ~ .e.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .f.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .c.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .d.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .e.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .f.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.d.svelte-xyz ~ .e.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.d.svelte-xyz ~ .f.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.e.svelte-xyz ~ .e.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.i.svelte-xyz ~ .j.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.g.svelte-xyz ~ .h.svelte-xyz ~ .j.svelte-xyz.svelte-xyz { color: green; } | ||
.g.svelte-xyz ~ .i.svelte-xyz ~ .j.svelte-xyz.svelte-xyz { color: green; } | ||
.m.svelte-xyz ~ .m.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.m.svelte-xyz ~ .l.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.l.svelte-xyz ~ .m.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .c.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .g.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .e.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .g.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .k.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.d.svelte-xyz ~ .d.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.g.svelte-xyz ~ .g.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.h.svelte-xyz ~ .h.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.i.svelte-xyz ~ .i.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.j.svelte-xyz ~ .j.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.g.svelte-xyz ~ .j.svelte-xyz.svelte-xyz.svelte-xyz { color: green; } | ||
.g.svelte-xyz ~ .h.svelte-xyz ~ .i.svelte-xyz ~ .j.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .f:where(.svelte-xyz) { color: green; } | ||
.b.svelte-xyz ~ .c:where(.svelte-xyz) { color: green; } | ||
.b.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .f:where(.svelte-xyz) { color: green; } | ||
.d.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } | ||
.d.svelte-xyz ~ .f:where(.svelte-xyz) { color: green; } | ||
.e.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } | ||
.i.svelte-xyz ~ .j:where(.svelte-xyz) { color: green; } | ||
.g.svelte-xyz ~ .h:where(.svelte-xyz) ~ .j:where(.svelte-xyz) { color: green; } | ||
.g.svelte-xyz ~ .i:where(.svelte-xyz) ~ .j:where(.svelte-xyz) { color: green; } | ||
.m.svelte-xyz ~ .m:where(.svelte-xyz) { color: green; } | ||
.m.svelte-xyz ~ .l:where(.svelte-xyz) { color: green; } | ||
.l.svelte-xyz ~ .m:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .c:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } | ||
.b.svelte-xyz ~ .e:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .k:where(.svelte-xyz) { color: green; } | ||
.d.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.g.svelte-xyz ~ .g:where(.svelte-xyz) { color: green; } | ||
.h.svelte-xyz ~ .h:where(.svelte-xyz) { color: green; } | ||
.i.svelte-xyz ~ .i:where(.svelte-xyz) { color: green; } | ||
.j.svelte-xyz ~ .j:where(.svelte-xyz) { color: green; } | ||
.g.svelte-xyz ~ .j:where(.svelte-xyz) { color: green; } | ||
.g.svelte-xyz ~ .h:where(.svelte-xyz) ~ .i:where(.svelte-xyz) ~ .j:where(.svelte-xyz) { color: green; } | ||
|
||
/* no match */ | ||
/* (unused) .e ~ .f { color: green; }*/ |
10 changes: 5 additions & 5 deletions
10
packages/svelte/tests/css/samples/general-siblings-combinator-each-else/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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
.a.svelte-xyz ~ .b.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .c.svelte-xyz { color: green; } | ||
.b.svelte-xyz ~ .d.svelte-xyz { color: green; } | ||
.c.svelte-xyz ~ .d.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .d.svelte-xyz { color: green; } | ||
.a.svelte-xyz ~ .b:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .c:where(.svelte-xyz) { color: green; } | ||
.b.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.c.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
.a.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; } | ||
|
||
/* no match */ | ||
/* (unused) .b ~ .c { color: green; }*/ |
Oops, something went wrong.