forked from mirror/crumbs-original
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:
co-authored by
Claude Opus 4.6
parent
0a2901572c
commit
9b1b8b0464
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user