app.html
1 <!-- src/app.html --> 2 <!DOCTYPE html> 3 <html lang="en"> 4 <head> 5 <meta charset="utf-8" /> 6 <link rel="icon" href="/favicon.png" /> 7 <link rel="stylesheet" href="/global.css" /> 8 <meta name="viewport" content="width=device-width, initial-scale=1" /> 9 %sveltekit.head% 10 <script> 11 // Apply theme before rendering to prevent flash of default theme 12 (function() { 13 try { 14 const storedTheme = localStorage.getItem('theme'); 15 if (storedTheme === 'dark') { 16 document.documentElement.classList.add('theme-dark'); 17 document.body.classList.add('dark'); 18 } 19 } catch (e) { 20 console.error('Error applying theme:', e); 21 } 22 })(); 23 </script> 24 </head> 25 <body> 26 <div>%sveltekit.body%</div> 27 </body> 28 </html>