-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Description
Describe the problem
Currently, if I want to give a svelte component a CSS class, i need to export a "className" prop so that I can reference it in the parent component. This doesn't work with scoped component styles, and I need to rely on :global() which does not seem like a good practice as it can affect other components. And I also want to avoid creating unnecessary wrapper elements for performance and CSS reasons.
Describe the proposed solution
Vue lets you bind the class property to an element in the component, so you can then use it in the parent component like a regular element. This would avoid needing to export the prop as "className", and would work with CSS scoping without needing to rely on :global().
https://vuejs.org/guide/essentials/class-and-style#with-components
Importance
nice to have
Metadata
Metadata
Assignees
Labels
No labels