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 ( -