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

@ -21,7 +21,7 @@
title: "Local Chapters",
blurb: "Optional line under the section heading.",
accent: "#0f7183", // heading, banner, rule
background: "#eef9fb",
background: "var(--color-tint)",
actions: <SomeButton />, // optional, right of the heading
content: <YourStuff />,
},
@ -32,6 +32,7 @@
import { useEffect, type ReactNode } from "react";
import { documentTitle } from "../lib/site.ts";
import { accentText } from '../lib/color.ts'
const TEAL = "#0f7183";
@ -75,10 +76,10 @@ export function Section({ section }: { section: ShellSection }) {
<div className="max-w-6xl mx-auto px-6 mb-10">
<div className="flex flex-wrap items-end justify-between gap-4">
<div>
<h2 className="text-4xl md:text-5xl font-extrabold" style={{ color: accent }}>
<h2 className="text-4xl md:text-5xl font-extrabold" style={{ color: accentText(accent) }}>
{title}
</h2>
{blurb && <p className="mt-2 text-[#4a6b72] max-w-xl">{blurb}</p>}
{blurb && <p className="mt-2 text-muted max-w-xl">{blurb}</p>}
</div>
{actions}
</div>
@ -101,12 +102,12 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
return (
<>
{/* Page header */}
<div className="pt-24 pb-12 px-6" style={{ background: "#eef9fb" }}>
<div className="pt-24 pb-12 px-6" style={{ background: "var(--color-tint)" }}>
<div className="max-w-6xl mx-auto">
<h1 className="text-5xl md:text-6xl font-extrabold" style={{ color: TEAL }}>
<h1 className="text-5xl md:text-6xl font-extrabold" style={{ color: accentText(TEAL) }}>
{title}
</h1>
{intro && <p className="mt-3 text-lg text-[#4a6b72] max-w-2xl">{intro}</p>}
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}
</div>
</div>