style: close sidebar by default on mobile

Use window.matchMedia to check viewport width on mount. Sidebar defaults
to closed, then opens automatically on desktop (>= 1024px).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Frederic Cabassut
2026-03-06 23:12:36 +01:00
co-authored by Claude Opus 4.6
parent 3edde569f0
commit eaa0a832e3
+2 -1
View File
@@ -8,9 +8,10 @@
import { onMount, onDestroy } from 'svelte';
let { data, children } = $props();
let sidebarOpen = $state(true);
let sidebarOpen = $state(false);
onMount(() => {
sidebarOpen = window.matchMedia('(min-width: 1024px)').matches;
loadNotes();
startSync();
});