diff --git a/src/compiler/compile/css/Stylesheet.ts b/src/compiler/compile/css/Stylesheet.ts index 0a3098db6d6..1a9ea7feeb5 100644 --- a/src/compiler/compile/css/Stylesheet.ts +++ b/src/compiler/compile/css/Stylesheet.ts @@ -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); }); diff --git a/test/css/samples/at-layer/expected.css b/test/css/samples/at-layer/expected.css new file mode 100644 index 00000000000..e5f3de80c95 --- /dev/null +++ b/test/css/samples/at-layer/expected.css @@ -0,0 +1 @@ +@layer base, special;@layer special{div.svelte-xyz{color:rebeccapurple}}@layer base{div.svelte-xyz{color:green}} \ No newline at end of file diff --git a/test/css/samples/at-layer/input.svelte b/test/css/samples/at-layer/input.svelte new file mode 100644 index 00000000000..60289e1e5f9 --- /dev/null +++ b/test/css/samples/at-layer/input.svelte @@ -0,0 +1,17 @@ +
hello
+ +