Skip to content

Commit 0165e89

Browse files
Divide-By-0claude
andcommitted
fix: force light theme to prevent white-on-light text on first visit
The app is a light-only design (hardcoded body bg, light text colors), but next-themes defaulted to system theme, so dark-mode-OS visitors got the `dark` class applied — flipping foreground to near-white text on the light background and making main page text invisible on first load. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 87b9749 commit 0165e89

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/app/layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ export default function RootLayout({
6464
<html lang="" suppressHydrationWarning>
6565
<body className={`${fustat.className} flex min-h-screen flex-col bg-[#F5F3EF] antialiased`}>
6666
<Suspense>
67-
<ThemeProvider attribute="class">
67+
{/* REASON: The app is a light-only design — the body bg is hardcoded to #F5F3EF
68+
and all text colors assume a light background. next-themes defaults to
69+
defaultTheme="system"/enableSystem, so dark-mode-OS visitors got the `dark`
70+
class on <html>, flipping --foreground to near-white text on the light bg
71+
(invisible main page text on first visit). There is no theme toggle in the UI,
72+
so we force light. Removing forcedTheme reintroduces the white-on-light bug. */}
73+
<ThemeProvider attribute="class" forcedTheme="light" enableSystem={false}>
6874
<CSPostHogProvider>
6975
<GoogleOAuthProvider clientId={process.env.GOOGLE_CLIENT_ID || ''}>
7076
<GoogleAuthProvider>

0 commit comments

Comments
 (0)