@layer tokens { /* ---- colourways (palettes) ---- * * Every colour is a variable and every palette is one self-contained block per mode, so a new * colourway is copy-one-pair-and-recolour. Four ship: footstrap (GitHub Primer, the default), * hicontrast, bootstrap (the stock LuCI theme's colours) and 2020. * * TO ADD A COLOURWAY "sunset": * 1. Copy the two hicontrast blocks below, rename data-palette to "sunset". * 2. Set every colour. FIVE are declared as -base with the live token derived from them, * so the colour axes can recolour them with no second copy to keep in sync: the canvas * --fs-bg-base → --fs-bg (TINT block), the accent --fs-accent-base → --fs-accent and * the three status colours --fs-good-base / --fs-warn-base / --fs-danger-base (COLOUR * AXES block). A palette never declares --fs-good itself. * 3. Set the four INKS (--fs-on-accent/-good/-warn/-danger) — see below. * 4. Register the name in all four places, because each one fails DIFFERENTLY and quietly: * the PALETTE axis in fs-prefs.js (live switching), the `_sd_pal` whitelist AND the * pre-paint switch in partials/head.ut (a router default outside the whitelist becomes * '' and the page paints in the default palette), the label map in fs-appearance.js (an * unnamed palette is missing from the picker, not broken), and matrix() in * tools/lib/gallery.mjs — a palette absent there is one export-tier.mjs and * a11y-gallery.mjs never measure, so it ships ungated. * Nothing else: layout, components and the --*-color-* export bridge key off these tokens, and * every tint, shadow and hairline is a color-mix() over them. * * The inks are per palette and per mode. A single global `--fs-on-accent: #fff` holds up on * the dark fills of a LIGHT palette and nowhere else — on a dark palette's light fills it * measures 1.69-2.80:1, where AA wants 4.5:1 for text and 3:1 for a UI shape. Check a new * colourway's inks against all four of its own fills; every pair below clears 4.5:1. * * A tint of X is mixed FROM X — do not reintroduce a component copy of a colour in any * notation (foot of 02-tokens.css). * * Default: footstrap fills bare :root, so a no-JS load still has colours; every other * colourway is opt-in. :root[data-palette=…][data-darkmode=…] (0,3,0) beats the bare blocks, * and each block sets a COMPLETE token set so the winner fully applies. */ /* Native