From 9951e9af5cef77dbaff2c8072228767848d4fb4b Mon Sep 17 00:00:00 2001 From: leaky001 Date: Mon, 20 Oct 2025 11:12:55 +0100 Subject: [PATCH] fix(theme): set html.dark before first paint to match Tailwind dark styles --- frontend/src/main.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index e98ecc4..9fa6a52 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -17,6 +17,8 @@ if (savedTheme) { initialTheme = 'dark'; } updateFavicon(initialTheme); +// Ensure the dark class is applied before first paint to avoid mismatch/flash +document.documentElement.classList.toggle('dark', initialTheme === 'dark'); ReactDOM.createRoot(document.getElementById('root')).render(