html: apply the saved theme before first paint
Inline head script sets data-theme from localStorage before the CSS loads, so returning users on dark/yomirc no longer flash the light default on load or reload. The full theme logic still runs later in src/ui/theme.ts.
This commit is contained in:
parent
cabe61733a
commit
ab482964f8
1 changed files with 3 additions and 0 deletions
|
|
@ -3,6 +3,9 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content" />
|
||||||
|
<!-- Apply the saved theme before first paint so there's no flash of the light
|
||||||
|
default on load/reload. Full theme logic runs later in src/ui/theme.ts. -->
|
||||||
|
<script>try{var t=localStorage.getItem('tchatou-theme');if(t)document.documentElement.dataset.theme=t}catch(e){}</script>
|
||||||
<meta name="theme-color" content="#ffffff" />
|
<meta name="theme-color" content="#ffffff" />
|
||||||
<link rel="manifest" href="/app/manifest.webmanifest" />
|
<link rel="manifest" href="/app/manifest.webmanifest" />
|
||||||
<link rel="icon" href="/app/orbit-icon.svg" type="image/svg+xml" />
|
<link rel="icon" href="/app/orbit-icon.svg" type="image/svg+xml" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue