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

@ -43,7 +43,7 @@ function Picture({ card }: { card: FeaturedCard }) {
const photo = card.image ? PHOTO_KINDS.has(card.image.kind) : false
if (!src || failed) {
return <div className="aspect-video w-full bg-gradient-to-br from-[#eef9fb] to-[#d9f0f3]" />
return <div className="aspect-video w-full bg-tint" />
}
return photo ? (
@ -55,7 +55,7 @@ function Picture({ card }: { card: FeaturedCard }) {
className="aspect-video w-full object-cover"
/>
) : (
<div className="flex aspect-video w-full items-center justify-center bg-[#eef9fb] p-8">
<div className="flex aspect-video w-full items-center justify-center bg-tint p-8">
<img
src={src}
alt=""
@ -78,10 +78,10 @@ function Card({ card }: { card: FeaturedCard }) {
const text = (
<div className="flex flex-1 flex-col p-6">
{card.eyebrow && (
<p className="text-xs font-bold uppercase tracking-[0.2em] text-[#0f7183]">{card.eyebrow}</p>
<p className="text-xs font-bold uppercase tracking-[0.2em] text-link">{card.eyebrow}</p>
)}
{card.title && (
<h3 className="mt-2 font-display text-xl font-extrabold leading-snug text-[#073d4a]">
<h3 className="mt-2 font-display text-xl font-extrabold leading-snug text-ink">
{href ? (
// Stretched over the whole card, so the picture and the
// blurb are part of the click without nesting links.
@ -96,12 +96,12 @@ function Card({ card }: { card: FeaturedCard }) {
)}
</h3>
)}
{card.blurb && <p className="mt-2 leading-relaxed text-[#4a6b72]">{card.blurb}</p>}
{card.blurb && <p className="mt-2 leading-relaxed text-muted">{card.blurb}</p>}
</div>
)
return (
<li className="relative flex flex-col overflow-hidden rounded-2xl border border-[#138ba0]/15 bg-white shadow-sm transition-shadow hover:shadow-lg">
<li className="relative flex flex-col overflow-hidden rounded-2xl border border-brand/15 bg-surface shadow-sm transition-shadow hover:shadow-lg">
{card.kind === 'video' ? (
// Above the stretched link, which a video card doesn't have
// anyway, so the play button always gets the click.