-
-
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: add css hash to custom element rendered with
svelte:element
(#…
…12715) * fix: add css hash to custom element rendered with `svelte:element` * simplify * skip arg where possible * drive-by improvements — remove some unnecessary arguments where possible --------- Co-authored-by: Rich Harris <[email protected]>
- Loading branch information
1 parent
8e04a91
commit 93cfa6c
Showing
6 changed files
with
53 additions
and
23 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: add css hash to custom element rendered with `svelte:element` |
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
14 changes: 14 additions & 0 deletions
14
...ages/svelte/tests/runtime-runes/samples/svelte-element-custom-element-css-hash/_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 |
---|---|---|
@@ -0,0 1,14 @@ | ||
import { ok, test } from '../../test'; | ||
|
||
export default test({ | ||
html: `<custom-element class="red svelte-p153w3"></custom-element><custom-element class="red svelte-p153w3"></custom-element>`, | ||
|
||
async test({ assert, target }) { | ||
const [el, el2] = target.querySelectorAll('custom-element'); | ||
ok(el); | ||
ok(el2); | ||
|
||
assert.deepEqual(el.className, 'red svelte-p153w3'); | ||
assert.deepEqual(el2.className, 'red svelte-p153w3'); | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
...ges/svelte/tests/runtime-runes/samples/svelte-element-custom-element-css-hash/main.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,8 @@ | ||
<svelte:element this={'custom-element'} class="red"></svelte:element> | ||
<custom-element class="red"></custom-element> | ||
|
||
<style> | ||
.red { | ||
color: red; | ||
} | ||
</style> |