-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
IntoStyle
for (&str, Option<T>)
s
#3568
Comments
I didn't know these are different but I actually need |
Done for 0.8 in #3618 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Conditionally setting css styles on an HTML element.
Describe the solution you'd like
In Leptos 0.6 it was possible to provide an
Option<T>
or anfn -> Option<T>
tostyle:cssprop=
attributes (i.e..style(("prop", Some("value")))
. I was somewhat depending on that feature, but it seems it was forgotten during the upgrade to 0.7.Describe alternatives you've considered
The workaround right now is to use style overrides (like
.unwrap_or("auto")
or use just a single style attribute for all styles and render the HTML. However both of these approaches have downsides as they are not able to precisely add and remove the singular style from the element.Additional context
I've tried doing he PR myself but actually the trait relationships with asyncOutput etc are really difficult and I'm not deep enough in the new leptos code base to understand it although I did spend a couple of hours trying to get something to work.
The text was updated successfully, but these errors were encountered: