-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Make it possible to have a different API for cls / className / classNames #32
Comments
In outwatch, we also handle Style is maybe another "special kind" of attribute where a different handling might be needed. How do we decide, which of the values needs a special handling and which one does not? Why do you not like overriding the value? |
Problem is, I want to be able to do pass both I guess I could work around this in Laminar with e.g. implicit value classes, but I'm not a fan of using implicits for such a popular use case. Besides, it's merely coincidental that I want to retain a string-based API in this case, and if I didn't want that I wouldn't have been able to accomplish what I want at all. I'm working on this now on Laminar side, we'll see how it goes... |
I see, that is indeed a good use case! In your dsl, you cannot diverge from the type signature of SDT and you are forced to expose it. Only changing semantics is possible. Totally agree with your initial approach of using an |
Alright, coming soon as v0.9. Existing consuming libraries will just need to mix in two more traits (HTML and SVG) to retain current functionality. |
As described in raquo/Laminar#22, consuming libraries might want to provide a special way to deal with CSS classes which is different from how they deal with other attributes.
It would benefit the consuming libraries if they could choose whether to keep the default cls / className / classNames API, but currently it's not possible.
I guess the most obvious solution to this problem would be to extract css / className / classNames (and perhaps also styleAttr?) into a separate OpinionatedAttrs trait that the consuming library may choose to not use.
The text was updated successfully, but these errors were encountered: