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

feat: support Option<_> in style: (closes #3568) #3618

Merged
merged 1 commit into from
Feb 15, 2025
Merged

feat: support Option<_> in style: (closes #3568) #3618

merged 1 commit into from
Feb 15, 2025

Conversation

gbj
Copy link
Collaborator

@gbj gbj commented Feb 15, 2025

I don't know that I've tested every permutation of these trait implementations, but have tested the following, for example.

#[component]
fn HomePage() -> impl IntoView {
    let count = RwSignal::new(0);

    view! {
        <button
            on:click=move |_| *count.write() += 1
            style:font-weight=move || (count.get() % 2 == 0).then_some("bold")
            style:padding-top=move || format!("{}px", count.get())
            style:text-decoration="underline"
            style="color: red"
        >
            "Click"
        </button>
    }
}

@gbj gbj merged commit 7157958 into leptos_0.8 Feb 15, 2025
72 of 74 checks passed
@gbj gbj deleted the 3568_0.8 branch February 15, 2025 21:47
zakstucke pushed a commit to zakstucke/leptos that referenced this pull request Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant