From 3d0c56391348efc0cf885fc5b8e51dfbe27283cb Mon Sep 17 00:00:00 2001 From: Kaparthy Reddy Date: Sun, 24 May 2026 14:15:55 +0530 Subject: [PATCH] fix(web): eliminate dark mode white flash on initial page load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add blocking inline IIFE script to in app.html that reads localStorage('devcard-theme') and falls back to window.matchMedia to apply the .dark class to before any content renders. Previously, the theme was applied inside onMount in +page.svelte, which runs after first paint — causing a visible white flash for dark mode users on hard refresh or slow page loads. Closes #91 --- apps/web/src/app.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app.html b/apps/web/src/app.html index 666257e..a843b8f 100644 --- a/apps/web/src/app.html +++ b/apps/web/src/app.html @@ -8,9 +8,25 @@ + + %sveltekit.head%
%sveltekit.body%
- + \ No newline at end of file