Skip to content

Commit 7e1691c

Browse files
authored
[fix] support @layer (#7514)
* add test * add layer to apply check
1 parent 4583b17 commit 7e1691c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/compiler/compile/css/Stylesheet.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class Atrule {
170170
}
171171

172172
apply(node: Element) {
173-
if (this.node.name === 'media' || this.node.name === 'supports') {
173+
if (this.node.name === 'media' || this.node.name === 'supports' || this.node.name === 'layer') {
174174
this.children.forEach(child => {
175175
child.apply(node);
176176
});

test/css/samples/at-layer/expected.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div>hello</div>
2+
3+
<style>
4+
@layer base, special;
5+
6+
@layer special {
7+
div {
8+
color: rebeccapurple;
9+
}
10+
}
11+
12+
@layer base {
13+
div {
14+
color: green;
15+
}
16+
}
17+
</style>

0 commit comments

Comments
 (0)