You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the only way to add custom styles to a component is to use CSS selectors, which are either too broad (eg. using mwc-textfield will get all textfields) or require wrapping with an element annotated with a custom class (eg. using the rule .foo-class > mwc-textfield). This makes material-yew difficult to use with frameworks such as tailwindcss.com.
I propose a solution as follows: add a class property to all existing components. This would look similar to the following:
It would only be passed straight through to the underlying MWC component, so ideally each material-yew component would only have three lines of additions.
I'd be grateful to hear your thoughts on this - I'm happy to contribute such a change via a PR if you deem it to be suitable.
The text was updated successfully, but these errors were encountered:
This would be a great addition but adding classes prop seems like a bandage over a much bigger issue, unable to pass props (such as classes) to components without defining everything manually. A actual solution was proposed for this here: yewstack/yew#1533 (comment).
If you can, I think it would be great if you could work on that for Yew. I'd prefer to have this solved at framework-level instead of a putting a bandage over the problem.
Currently, the only way to add custom styles to a component is to use CSS selectors, which are either too broad (eg. using
mwc-textfield
will get all textfields) or require wrapping with an element annotated with a custom class (eg. using the rule.foo-class > mwc-textfield
). This makesmaterial-yew
difficult to use with frameworks such as tailwindcss.com.I propose a solution as follows: add a
class
property to all existing components. This would look similar to the following:It would only be passed straight through to the underlying MWC component, so ideally each
material-yew
component would only have three lines of additions.I'd be grateful to hear your thoughts on this - I'm happy to contribute such a change via a PR if you deem it to be suitable.
The text was updated successfully, but these errors were encountered: