- Inline <script> in app.html applies saved localStorage theme before first paint to prevent flash of wrong theme - ThemeToggle.svelte: moon/sun button, localStorage persistence, sets data-theme on <html>, defaults to system preference on first visit - Placed in +layout.svelte between language selector and user menu - E2E tests cover visibility, toggle, reverse toggle, persistence, and no-flash behaviour — all 6 passing Refs #64 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
488 B
HTML
18 lines
488 B
HTML
<!doctype html>
|
|
<html lang="%paraglide.lang%">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<script>
|
|
(function () {
|
|
var t = localStorage.getItem('theme');
|
|
if (t === 'dark' || t === 'light') document.documentElement.setAttribute('data-theme', t);
|
|
})();
|
|
</script>
|
|
%sveltekit.head%
|
|
</head>
|
|
<body data-sveltekit-preload-data="hover">
|
|
<div style="display: contents">%sveltekit.body%</div>
|
|
</body>
|
|
</html>
|