Closed
Description
Describe the bug
Using CSS cascade layers in a Svelte component results in the styles inside the layer being stripped from the final output without warning.
Reproduction
Component:
<div class="item">I am displayed in <code>color: rebeccapurple</code>
because the <code>special</code> layer comes after the <code>base</code> layer.
My green border, font-size, and padding come from the <code>base</code> layer.</div>
<style>
@layer base, special;
@layer special {
.item {
color: rebeccapurple;
}
}
@layer base {
.item {
color: green;
border: 5px solid green;
font-size: 1.3em;
padding: .5em;
}
}
</style>
Compiled style:
@layer base, special;@layer special{}@layer base{}
Wrapping the selectors in :global
includes them in the final output, but then the styles are not scoped.
(Code taken from an example on MDN)
Logs
No response
System Info
Svelte REPL, v3.48
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels