b7093b703a
- Palette: gray/zinc/slate/neutral → stein, red → fire, amber → erde, sky → himmel, green → wald - Footer: replaced raw rgb with stein tokens - Radius: unified to rounded-xs across cards, buttons, inputs, pagination - Buttons: .btn-primary/.btn-secondary now font-medium; added secondary - Card hover: -translate-y-0.5 + shadow + wald-300 border - Header active link: wald border-bottom + wald-700 text - Mobile nav: bigger touch targets + wald active accent - Pagination: prev/next text labels + wald-500 active state with separated shape/color classes to avoid Tailwind conflicts - Lead paragraph: scoped .markdown > p:first-child for top-level MarkdownBlock only via [data-block-type="markdown"] - Section dividers: subtle wald-200 gradient between content rows - Global focus-visible ring (wald-500) - Inline hex → palette tokens (Badge amber, Tag custom-color contrast) - Font weights snapped to design system (300/400/500/600/700) - transition-all → transition-colors where only color changes - Removed em-dashes from user-visible templates Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
46 lines
1.1 KiB
Svelte
46 lines
1.1 KiB
Svelte
<script lang="ts">
|
|
import type { Snippet } from "svelte";
|
|
import Icon from "@iconify/svelte";
|
|
import "$lib/iconify-offline";
|
|
|
|
interface Props {
|
|
label: string;
|
|
open?: boolean;
|
|
lazy?: boolean;
|
|
id?: string;
|
|
class?: string;
|
|
onToggleEvent?: (e: Event) => void;
|
|
children: Snippet;
|
|
}
|
|
|
|
let {
|
|
label,
|
|
open = false,
|
|
lazy = false,
|
|
id = undefined,
|
|
class: cls = "",
|
|
onToggleEvent,
|
|
children,
|
|
}: Props = $props();
|
|
|
|
let everOpened = $state(false);
|
|
const mounted = $derived(!lazy || open || everOpened);
|
|
|
|
function onToggle(e: Event) {
|
|
if ((e.target as HTMLDetailsElement).open) everOpened = true;
|
|
onToggleEvent?.(e);
|
|
}
|
|
</script>
|
|
|
|
<details {id} {open} ontoggle={onToggle} class="pt-4 border-t border-stein-200 group {cls}">
|
|
<summary class="flex cursor-pointer list-none items-center gap-2 text-sm font-medium select-none">
|
|
<Icon icon="mdi:chevron-right" class="size-4 shrink-0 transition-transform group-open:rotate-90" />
|
|
{label}
|
|
</summary>
|
|
<div class="mt-4">
|
|
{#if mounted}
|
|
{@render children()}
|
|
{/if}
|
|
</div>
|
|
</details>
|