From 0d84e4b70db4f96d5fdbc28bdd6ae1e8ab0b667c Mon Sep 17 00:00:00 2001 From: Ou Date: Thu, 17 Oct 2024 15:43:20 +0800 Subject: [PATCH] chore: apply color immediately --- index.html | 7 +++++++ src/routes/__root.tsx | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index ccaabf1..84146c9 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,13 @@ + NewsNow diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index a625b8f..8c0fa30 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -17,12 +17,6 @@ export const Route = createRootRouteWithContext<{ component: RootComponent, notFoundComponent: NotFoundComponent, beforeLoad: () => { - const theme = localStorage.getItem("color-scheme") || "auto" - const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches - if (theme === "auto" ? isDark : theme === "dark") { - document.documentElement.classList.add("dark") - } - const query = new URLSearchParams(window.location.search) if (query.has("login")) { [...query.entries()].forEach(key => localStorage.setItem(key[0], key[1]))