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 <noreply@anthropic.com>
43 lines
1.7 KiB
HTML
43 lines
1.7 KiB
HTML
<!doctype html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
/>
|
|
<!-- Set from the resolved theme (script below and `theme-provider.tsx`), not with
|
|
`media` queries: those follow the OS and ignore the theme picked in the app. -->
|
|
<meta name="theme-color" content="#f9f8f5" />
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
<meta name="apple-mobile-web-app-title" content="Superlist" />
|
|
<title>Superlist — Listas de compras compartidas</title>
|
|
<script>
|
|
// Applies the stored theme (or the OS one) before the first paint. It has
|
|
// to run in the HTML, outside React: React never executes scripts it
|
|
// renders on the client. Keep in sync with `theme-provider.tsx`.
|
|
(() => {
|
|
var stored = null
|
|
try {
|
|
stored = localStorage.getItem('superlist-theme')
|
|
} catch {}
|
|
var dark =
|
|
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')
|
|
})()
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|