Skip to content
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

Class directive for components #5236

Closed
AhmadMayo opened this issue Aug 4, 2020 · 3 comments
Closed

Class directive for components #5236

AhmadMayo opened this issue Aug 4, 2020 · 3 comments

Comments

@AhmadMayo
Copy link

Is your feature request related to a problem? Please describe.
Svelte components have the look and feel of vanilla html. Feature requests like #3852 - I'm assuming - supports the argument that svelte developers wants to keep components' props as close to html attributes as possible. Having class directives working with components in the same way they work with html elements would be a nice feature to have for component libraries' developers.

Describe the solution you'd like

<MyComponent class:first class="second" class={condition ? classVar : ''} />

and may be access the compiled prop through $$class // "first second valueOfClassVar" - may be even exclude it from $$restProp?

Describe alternatives you've considered
passing the calculated string to a custom prop (className for example), and let the user handle the logic to calculate the end result of the string.

How important is this feature to you?
Not very important, but I think it would be nice to have it.

Additional context
None

@Conduitry
Copy link
Member

See also #4749.

@stale
Copy link

stale bot commented Jun 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 27, 2021
@stale
Copy link

stale bot commented Jul 11, 2021

This issue has been closed as it was previously marked as stale and saw no subsequent activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants