~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
main
26 lines · 934 B Raw History
<script lang="ts">
  import { m } from '#lib/paraglide/messages.js';
  import { choose, type Appearance } from '#lib/appearance.ts';
  /** The reader's choice of light or dark, or as their system has it (`chosen`), changed in a click, and kept. */
  let { chosen }: { chosen: Appearance } = $props();
  const options: { value: Appearance; text: string }[] = [
    { value: 'system', text: m.appearance_system() },
    { value: 'light', text: m.appearance_light() },
    { value: 'dark', text: m.appearance_dark() }
  ];
</script>

<p class="menu-label" id="appearance-label">{m.appearance_label()}</p>
<div class="appearance" role="radiogroup" aria-labelledby="appearance-label">
  {#each options as o (o.value)}
    <label
      ><input
        type="radio"
        name="appearance"
        value={o.value}
        checked={chosen === o.value}
        onchange={() => choose(o.value)}
      />{o.text}</label
    >
  {/each}
</div>