From 71793dbd3ab1845c66f7b145b51f5a9c466dbeac Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Tue, 20 Oct 2026 19:24:38 -0300 Subject: [PATCH] fix(web): match the iOS status bar to the theme picked in the app The theme-color metas used prefers-color-scheme media queries, so they followed the OS theme and ignored the in-app choice. Use a single meta that the pre-paint script and ThemeProvider update. Co-Authored-By: Claude Opus 5.5 --- apps/web/index.html | 8 ++++++-- apps/web/src/components/theme-provider.tsx | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/web/index.html b/apps/web/index.html index f8d8187..0b98453 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -8,8 +8,9 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> - - + + @@ -28,6 +29,9 @@ stored === 'dark' || (stored !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches) document.documentElement.classList.toggle('dark', dark) document.documentElement.style.colorScheme = dark ? 'dark' : 'light' + document + .querySelector('meta[name="theme-color"]') + .setAttribute('content', dark ? '#0f1411' : '#f9f8f5') })() diff --git a/apps/web/src/components/theme-provider.tsx b/apps/web/src/components/theme-provider.tsx index f41369b..3ede646 100644 --- a/apps/web/src/components/theme-provider.tsx +++ b/apps/web/src/components/theme-provider.tsx @@ -16,6 +16,9 @@ type ThemeContextValue = { const STORAGE_KEY = 'superlist-theme' const DARK_QUERY = '(prefers-color-scheme: dark)' +/** Browser chrome color (the iOS status bar) per theme. Keep in sync with `index.html`. */ +const THEME_COLORS: Record = { light: '#f9f8f5', dark: '#0f1411' } + /** * This theme handling is hand-rolled on purpose. Libraries such as `next-themes` * avoid the pre-paint flash by rendering a `