[fix] support @layer (#7514)

* add test

* add layer to apply check
pull/7658/head
kindoflew 2 years ago committed by GitHub
parent 4583b17084
commit 7e1691cd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -170,7 +170,7 @@ class Atrule {
}
apply(node: Element) {
if (this.node.name === 'media' || this.node.name === 'supports') {
if (this.node.name === 'media' || this.node.name === 'supports' || this.node.name === 'layer') {
this.children.forEach(child => {
child.apply(node);
});

@ -0,0 +1 @@
@layer base, special;@layer special{div.svelte-xyz{color:rebeccapurple}}@layer base{div.svelte-xyz{color:green}}

@ -0,0 +1,17 @@
<div>hello</div>
<style>
@layer base, special;
@layer special {
div {
color: rebeccapurple;
}
}
@layer base {
div {
color: green;
}
}
</style>
Loading…
Cancel
Save