mirror of https://github.com/sveltejs/svelte
Fix for :global(...) styles in custom elements. Close #2969
parent
1ef7601d69
commit
ec12b99c92
@ -0,0 +1,9 @@
|
||||
<svelte:options tag="custom-element"/>
|
||||
|
||||
<style>
|
||||
:global(p.active) {
|
||||
color:rgb(128, 128, 128);
|
||||
}
|
||||
</style>
|
||||
|
||||
<p></p>
|
@ -0,0 +1,12 @@
|
||||
import * as assert from 'assert';
|
||||
import CustomElement from './main.svelte';
|
||||
|
||||
export default function (target) {
|
||||
new CustomElement({
|
||||
target
|
||||
});
|
||||
|
||||
const style = target.querySelector('custom-element').shadowRoot.querySelector('style');
|
||||
|
||||
assert.equal(style.textContent, 'p.active{color:rgb(128, 128, 128)}');
|
||||
}
|
Loading…
Reference in new issue