---/** * The palette switcher, beside the sun/moon toggle in the masthead — the * same control as daemon-sec.xyz's. The toggle answers "light or dark"; * this answers "which family" (Rosé Pine, Gruvbox, Gruvepine), and the two * are independent, so every palette keeps both of its modes. * * The button wears the current palette's three dots. All three sets are in * the markup and palettes.css shows the one matching `<html data-palette>`, * so the button is right before any script runs. Behaviour is in * src/scripts/palette.ts; the list itself is generated (src/lib/palettes.ts). */import { PALETTES } from'../lib/palettes';
---<divclass="mast__palette"data-palette-picker>
<buttonclass="mast__icon mast__palette-btn"type="button"aria-haspopup="menu"aria-expanded="false"aria-label="Palette"title="Palette"data-palette-trigger >
{PALETTES.map((p) => (
<spanclass="pal-dots"data-palette-dots={p.id} aria-hidden="true">
{p.swatch.map((c) => <istyle={`background:${c}`}></i>)}
</span>
))}
</button>
<divclass="mast__palette-menu"role="menu"aria-label="Palette"hiddendata-palette-menu>
<pclass="mast__palette-label"aria-hidden="true">Palette</p>
{PALETTES.map((p) => (
<buttontype="button"role="menuitemradio"aria-checked="false"tabindex="-1"data-palette-id={p.id}>
<spanclass="pal-dots pal-dots--on"aria-hidden="true">
{p.swatch.map((c) => <istyle={`background:${c}`}></i>)}
</span>
<spanclass="mast__palette-name">{p.name}</span>
<spanclass="mast__palette-tick"aria-hidden="true">✓</span>
</button>
))}
</div>
</div>