Closed
Description
Describe the bug
In https://svelte.dev/docs#script there is a part on how to expose reserved keywords like class
to parent components.
I tried to include this in my app, but the optimizations / scoping of styles prevent that with the current version 3.17.1
To Reproduce
https://svelte.dev/repl/59207aa8c9284598a44489414267796c?version=3.17.1
Actual behaviour
- If the Child component is the only element in the markup that uses the class, the styles are marked as unused. I suppose therefore they will just become removed during compilation, right?
- If a second element using the styles is placed in the markup, svelte correctly generates the svelte- hash class for the current scope, and also correctly applies the styles to the second element. The first element however does not get the scoped svelte class applied.
Expected behavior
If I pass down the classname to a child component, I expect the styles to not being marked as unused and svelte to apply the scoped hash class to the child component.
Metadata
Metadata
Assignees
Labels
No labels