From e7110c44baac30a812b0d13240e6108c372873bb Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 17 Sep 2026 12:06:25 +0200 Subject: [PATCH] fix(theme): no - ); + // Intentionally empty: theme is applied client-side via ThemeSync. + return null; } \ No newline at end of file diff --git a/src/components/theme/theme-sync.tsx b/src/components/theme/theme-sync.tsx new file mode 100644 index 0000000..d98492a --- /dev/null +++ b/src/components/theme/theme-sync.tsx @@ -0,0 +1,35 @@ +"use client"; + +import { useEffect } from "react"; + +/** + * Applies the user's stored theme preference as soon as React mounts. + * + * The first paint already uses the OS preference (handled in globals.css via + * `@media (prefers-color-scheme: dark)`), so this is purely the override for + * the rare user who picked the opposite of their OS default. The brief flash + * is intentional — it avoids the only path Next.js 16 + React 19 leave for + * a pre-paint inline script: a `