From a4c3d36e59dc1d00e30f64de95a31efc8c8e98a8 Mon Sep 17 00:00:00 2001 From: seaznCode Date: Tue, 27 Jan 2026 18:49:00 +0100 Subject: [PATCH] fix: enforce dark theme by default and update CSS variables --- src/app/components/nav/Header.tsx | 13 ++----------- src/app/globals.css | 11 ++--------- src/app/layout.tsx | 2 +- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/app/components/nav/Header.tsx b/src/app/components/nav/Header.tsx index 043f07a..18e64b6 100644 --- a/src/app/components/nav/Header.tsx +++ b/src/app/components/nav/Header.tsx @@ -106,18 +106,9 @@ export default function Header({ setGlobalLoggingOut }: HeaderProps) { return 'U' } - // Initial theme (dark/light) + mark mounted + start header animation + // Initial theme (force dark) + mark mounted + start header animation useEffect(() => { - const stored = localStorage.getItem('theme') - const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches - const useDark = stored === 'dark' || (!stored && prefersDark) - - if (useDark) { - document.documentElement.classList.add('dark') - } else { - document.documentElement.classList.remove('dark') - } - + document.documentElement.classList.add('dark') setMounted(true) setAnimateIn(true) }, []) diff --git a/src/app/globals.css b/src/app/globals.css index 93d2bc5..c708ea2 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,8 +1,8 @@ @import "tailwindcss"; :root { - --background: #ffffff; - --foreground: #171717; + --background: #0a0a0a; + --foreground: #ededed; /* Brand Colors */ --color-brand-accent: #8D6B1D; @@ -19,13 +19,6 @@ /* Theme variables moved to :root for compatibility */ -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} - html { overflow-x: hidden; } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 595f877..75f3fbd 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -28,7 +28,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - +