mirror of https://github.com/sveltejs/svelte
parent
59a379596c
commit
e006ac5d3f
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: always inject styles when compiling as a custom element
|
@ -0,0 +1,9 @@
|
|||||||
|
<svelte:options customElement={{ tag: 'my-thing' }} />
|
||||||
|
|
||||||
|
<h1>hello</h1>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
h1 {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,15 @@
|
|||||||
|
import { tick } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['client'],
|
||||||
|
async test({ assert, target }) {
|
||||||
|
const thing = /** @type HTMLElement & { object: { test: true }; } */ (
|
||||||
|
target.querySelector('my-thing')
|
||||||
|
);
|
||||||
|
|
||||||
|
await tick();
|
||||||
|
|
||||||
|
assert.include(thing.shadowRoot?.innerHTML, 'red');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
import './Thing.svelte';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<my-thing></my-thing>
|
Loading…
Reference in new issue