Add colour tokens, dark mode and drop gradients

- Colour tokens in index.css named by role (ink, body, muted, link,
  brand, action, surface, tint, danger), used everywhere instead of hex
- Dark mode: follows the system, a header toggle (site and admin)
  overrides it and is remembered; set before first paint in index.html
- Data colours go through src/lib/color.ts: withAlpha for tints,
  accentText (lighter on dark) for text in an accent, readableOn for
  text on one, so an admin's pale colour still reads
- Migration 040 drops events.gradient: a card is its photo or plain,
  with its colour as the border; other decorative gradients are solid
- The countdown and a hero event without a photo mix their colour
  toward ink behind white text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:42:59 -05:00
parent ee61568911
commit c74ad746f5
70 changed files with 829 additions and 596 deletions

View file

@ -11,6 +11,74 @@
@theme {
--font-display: 'Poppins', sans-serif;
--font-body: 'Montserrat', sans-serif;
/* ── Colour tokens ─────────────────────────────────────────────
Named for what they do, not what they look like, because dark
mode (below) swaps the values. Use them as utilities
(text-muted, bg-surface, border-brand/20) or, in a style prop,
as var(--color-muted). Every text colour passes WCAG AA (4.5:1)
on surface, tint and tint-soft in both modes.
A colour that must stay the same in both modes (white text on
a dark band, a platform's own colour) stays a literal. Colours
that arrive as data (page accents, event and region colours) go
through withAlpha() and accentText() in src/lib/color.ts. */
--color-ink: #073d4a; /* headings */
--color-body: #26454c; /* body text */
--color-muted: #4a6b72; /* secondary text, quiet borders */
--color-link: #0f7183; /* links and teal text */
--color-brand: #138ba0; /* decoration: borders, rings, rules */
--color-action: #0f7183; /* button fills, under white text */
--color-action-hover: #0b5c6a;
--color-surface: #ffffff; /* page and cards */
--color-tint: #eef9fb; /* tinted sections and panels */
--color-tint-soft: #f6fbfc; /* hover rows, faint panels */
--color-danger: #b3261e;
--color-danger-tint: #fdf3f2;
}
/* How much of an accent colour its text keeps (src/lib/color.ts,
accentText): all of it on light, half (the rest white) on dark. */
:root {
--accent-text-mix: 100%;
}
/* Dark mode: the visitor's system setting, unless the header toggle
chose (data-theme on <html>, set before first paint in index.html
and by ThemeToggle). */
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
@layer base {
:root[data-theme="dark"] {
--color-ink: #eaf6f8;
--color-body: #cde0e4;
--color-muted: #9fb9bf;
--color-link: #5ccbdc;
--color-brand: #2aa7bc;
--color-surface: #0c1d21;
--color-tint: #11292e;
--color-tint-soft: #0f2428;
--color-danger: #ff8a80;
--color-danger-tint: #3b1714;
--accent-text-mix: 50%;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--color-ink: #eaf6f8;
--color-body: #cde0e4;
--color-muted: #9fb9bf;
--color-link: #5ccbdc;
--color-brand: #2aa7bc;
--color-surface: #0c1d21;
--color-tint: #11292e;
--color-tint-soft: #0f2428;
--color-danger: #ff8a80;
--color-danger-tint: #3b1714;
--accent-text-mix: 50%;
color-scheme: dark;
}
}
}
* {
@ -24,7 +92,7 @@ html {
/* One visible focus ring for keyboard users, wherever a component
doesn't draw its own. */
:focus-visible {
outline: 2px solid #0f7183;
outline: 2px solid var(--color-link);
outline-offset: 2px;
}
@ -45,8 +113,8 @@ html {
body {
font-family: 'Montserrat', sans-serif;
background-color: #ffffff;
color: #073d4a;
background-color: var(--color-surface);
color: var(--color-ink);
-webkit-font-smoothing: antialiased;
}