From aa4e1844a37b2d32f9a3f8488a7152e33220f84b Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 29 May 2026 21:22:20 +0200 Subject: [PATCH] remove theme init script --- src/routes/__root.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index 8d976dd..c74314a 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -7,8 +7,6 @@ import Header from "../components/Header"; import appCss from "../styles.css?url"; -const THEME_INIT_SCRIPT = `(function(){try{var stored=window.localStorage.getItem('theme');var mode=(stored==='light'||stored==='dark'||stored==='auto')?stored:'auto';var prefersDark=window.matchMedia('(prefers-color-scheme: dark)').matches;var resolved=mode==='auto'?(prefersDark?'dark':'light'):mode;var root=document.documentElement;root.classList.remove('light','dark');root.classList.add(resolved);if(mode==='auto'){root.removeAttribute('data-theme')}else{root.setAttribute('data-theme',mode)}root.style.colorScheme=resolved;}catch(e){}})();`; - export const Route = createRootRoute({ head: () => ({ meta: [ @@ -37,10 +35,9 @@ function RootDocument({ children }: { children: ReactNode }) { return ( -