Skip to content

Commit

Permalink
[fix] support @layer (#7514)
Browse files Browse the repository at this point in the history
* add test

* add layer to apply check
  • Loading branch information
kindoflew committed Jul 4, 2022
1 parent 4583b17 commit 7e1691c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/compile/css/Stylesheet.ts
Expand Up @@ -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);
});
Expand Down
1 change: 1 addition & 0 deletions test/css/samples/at-layer/expected.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions test/css/samples/at-layer/input.svelte
@@ -0,0 +1,17 @@
<div>hello</div>

<style>
@layer base, special;
@layer special {
div {
color: rebeccapurple;
}
}
@layer base {
div {
color: green;
}
}
</style>

0 comments on commit 7e1691c

Please sign in to comment.