-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styles get uncorrectly removed / how to pass down styles? #4281
Comments
This feature is working as intended, and this issue is basically a duplicate of #2870/#2888, which is not how we want to handle styling child components. A prop called You may also be interested in sveltejs/rfcs#13 which is a proposal for how to style child components using an API explicitly defined by the child. |
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
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.
The text was updated successfully, but these errors were encountered: