final toggle style

This commit is contained in:
2025-11-06 10:45:29 -05:00
parent e802d6238e
commit 8818ee6497
8 changed files with 40 additions and 106 deletions
+2 -9
View File
@@ -37,16 +37,9 @@ const title = Astro.props.title || Astro.props.frontmatter?.title || "Unknown";
class="layout-simple"
x-data="{
drawerOpen: false,
theme: $persist('system'),
isDark() {
const osIsDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (this.theme === 'dark' || this.theme === 'system' && osIsDark) return true;
return false;
}
darkMode: $persist(false)
}"
:class="{ 'lock-scroll': drawerOpen, 'theme-dark': isDark()}"
:class="{ 'lock-scroll': drawerOpen, 'theme-dark': darkMode}"
>
<Header />
<main transition:animate="initial">