-
-
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: remove scoping for most
:not
selectors (#14177)
fixes #14168 This reverts the whole "selectors inside `:not` are scoped" logic. Scoping is done so that styles don't bleed. But within `:not`,everything is reversed, which means scoping the selectors now means they are more likely to bleed. That is the opposite of what we want to achieve, therefore we should just leave those selectors alone. The exception are `:not` selectors with descendant selectors, as that means "look up the tree" and we need to scope all ancestor elements in that case.
- Loading branch information
1 parent
d033377
commit aa23415
Showing
18 changed files
with
172 additions
and
171 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: remove scoping for `:not` 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
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
17 changes: 1 addition & 16 deletions
17
packages/svelte/tests/css/samples/not-selector-global/_config.js
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,20 +1,5 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
warnings: [ | ||
{ | ||
code: 'css_unused_selector', | ||
message: 'Unused CSS selector ":global(.x) :not(p)"', | ||
start: { | ||
line: 14, | ||
column: 1, | ||
character: 197 | ||
}, | ||
end: { | ||
line: 14, | ||
column: 20, | ||
character: 216 | ||
} | ||
} | ||
] | ||
warnings: [] | ||
}); |
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: 3 additions & 1 deletion
4
packages/svelte/tests/css/samples/not-selector-global/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 |
---|---|---|
@@ -1 +1,3 @@ | ||
<p class="foo svelte-xyz">foo</p> <p class="bar svelte-xyz">bar</p> | ||
<p class="foo svelte-xyz">foo</p> | ||
<p class="bar svelte-xyz">bar <span class="svelte-xyz">baz</span></p> | ||
<span class="svelte-xyz">buzz</span> |
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
5 changes: 0 additions & 5 deletions
5
packages/svelte/tests/css/samples/not-selector-hash-on-right-elements/_config.js
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/svelte/tests/css/samples/not-selector-hash-on-right-elements/expected.css
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/svelte/tests/css/samples/not-selector-hash-on-right-elements/expected.html
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/svelte/tests/css/samples/not-selector-hash-on-right-elements/input.svelte
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.