fixed light theme

This commit is contained in:
2026-03-27 12:58:04 +01:00
parent b550a606f5
commit 8e10cb9d17
3 changed files with 46 additions and 28 deletions

View File

@@ -40,6 +40,8 @@ try {
<title>{title} | {siteConfig.title}</title>
{siteConfig.custom_css && <style set:html={siteConfig.custom_css} />}
<script is:inline define:vars={{ defaultTheme: siteConfig.theme }}>
// Prevention of FOUC (Flash of Unstyled Content)
// Immediately apply theme before rendering
const savedTheme = localStorage.getItem('user-theme') || defaultTheme;
document.documentElement.className = savedTheme;
</script>