From 596b07ee2df2ca6ffbaa5f459ba33859ecc6fb1b Mon Sep 17 00:00:00 2001 From: Ou Date: Thu, 17 Oct 2024 04:45:46 +0800 Subject: [PATCH] fix: auto thme --- src/routes/__root.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index c9d78e3..a625b8f 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -19,7 +19,7 @@ export const Route = createRootRouteWithContext<{ beforeLoad: () => { const theme = localStorage.getItem("color-scheme") || "auto" const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches - if (!theme ? isDark : theme === "dark") { + if (theme === "auto" ? isDark : theme === "dark") { document.documentElement.classList.add("dark") }