From 1931c53ac500e567bff0fb573f40c60955bf2c26 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 7 Nov 2024 13:01:56 +0100 Subject: [PATCH] Fix dark mode toggle --- src/frontend/components/nav.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/components/nav.rs b/src/frontend/components/nav.rs index 47642aa..3a9d0ef 100644 --- a/src/frontend/components/nav.rs +++ b/src/frontend/components/nav.rs @@ -126,7 +126,13 @@ pub fn Nav() -> impl IntoView { ().is_dark() } + checked=move || { + if expect_context::().is_light() { + "checked" + } else { + "" + } + } on:click=move |_| { expect_context::().toggle() } /> Dark