forked from mirror/crumbs-original
Separates --hover-wash from --border so the softened dark-mode border grey no longer collapses hover/active tint washes to near-invisibility (measured 5% wash on --bg-surface: 4.7 -> 17.0 RGB distance). Light mode is unaffected since --hover-wash falls back to var(--border) in :root. Also fixes stale/incorrect claims surfaced by the final review: the checkbox rule and missing CSS variables in CLAUDE.md, the "warm parchment" description of dark mode in FEATURES.md, the chip contrast claim in the palette design doc (chips are 3:1 UI, not 4:1 text), and adds a measured lightness-floor test guarding against chips regressing to card lightness.
54 lines
1.5 KiB
Svelte
54 lines
1.5 KiB
Svelte
<script lang="ts">
|
|
import SearchBar from '../SearchBar.svelte';
|
|
import SyncIndicator from '../SyncIndicator.svelte';
|
|
import Menu from 'lucide-svelte/icons/menu';
|
|
import Search from 'lucide-svelte/icons/search';
|
|
|
|
interface Props {
|
|
onMenuToggle: () => void;
|
|
}
|
|
|
|
let { onMenuToggle }: Props = $props();
|
|
let mobileSearchOpen = $state(false);
|
|
</script>
|
|
|
|
<header class="sticky top-0 z-30 flex h-16 items-center gap-4 border-b border-[var(--border)] bg-[var(--bg-surface)] px-4">
|
|
{#if mobileSearchOpen}
|
|
<!-- Mobile expanded search -->
|
|
<div class="flex flex-1 items-center gap-2 lg:hidden">
|
|
<SearchBar onClose={() => (mobileSearchOpen = false)} />
|
|
</div>
|
|
{:else}
|
|
<button
|
|
onclick={onMenuToggle}
|
|
class="rounded-sm p-2 hover:bg-[var(--hover-wash)]/10"
|
|
aria-label="Toggle sidebar"
|
|
>
|
|
<Menu class="h-6 w-6 text-[var(--text)]" />
|
|
</button>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<img src="/favicon.svg" alt="" class="h-8 w-8" />
|
|
<h1 class="font-['Press_Start_2P'] text-lg text-[var(--primary)]">Crumbs</h1>
|
|
</div>
|
|
|
|
<!-- Desktop search bar -->
|
|
<div class="mx-4 hidden flex-1 lg:block">
|
|
<SearchBar />
|
|
</div>
|
|
|
|
<!-- Mobile search icon -->
|
|
<button
|
|
onclick={() => (mobileSearchOpen = true)}
|
|
class="ml-auto rounded-sm p-2 hover:bg-[var(--hover-wash)]/10 lg:hidden"
|
|
aria-label="Search"
|
|
>
|
|
<Search class="h-5 w-5 text-[var(--text)]" />
|
|
</button>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<SyncIndicator />
|
|
</div>
|
|
{/if}
|
|
</header>
|