mirror of https://github.com/sveltejs/svelte
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 <rich.harris@vercel.com>pull/12735/head
parent
8e04a91c67
commit
93cfa6cd69
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: add css hash to custom element rendered with `svelte:element`
|
@ -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');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,8 @@
|
|||||||
|
<svelte:element this={'custom-element'} class="red"></svelte:element>
|
||||||
|
<custom-element class="red"></custom-element>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.red {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue