spb/autoscholar
Public
1/** Applies the stored theme before paint to avoid a flash; inline script is allowed by CSP (unsafe-inline for scripts). */2export function ThemeScript() {3 const code = `(function(){try{var s=localStorage.getItem('as-theme');var d=s?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;if(d)document.documentElement.classList.add('dark');}catch(e){}})();`;4 // biome-ignore lint/security/noDangerouslySetInnerHtml: static, constant script5 return <script dangerouslySetInnerHTML={{ __html: code }} />;6}7