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

@ -71,10 +71,10 @@ function Label({ section }: { section: EditorSection }) {
<>
<span className="truncate">{section.label}</span>
{section.count != null && (
<span className="text-xs text-[#4a6b72]/70">({section.count})</span>
<span className="text-xs text-muted/70">({section.count})</span>
)}
{section.hasError && (
<span aria-label="needs attention" className="h-1.5 w-1.5 shrink-0 rounded-full bg-[#b3261e]" />
<span aria-label="needs attention" className="h-1.5 w-1.5 shrink-0 rounded-full bg-danger" />
)}
</>
);
@ -87,10 +87,10 @@ export function SectionNav({ sections }: { sections: EditorSection[] }) {
return (
<nav aria-label="Sections" className="hidden max-h-[calc(100vh-8rem)] overflow-y-auto lg:block">
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-[#4a6b72]/70">
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-muted/70">
On this page
</p>
<ul className="space-y-0.5 border-l border-[#138ba0]/15">
<ul className="space-y-0.5 border-l border-brand/15">
{sections.map((section) => {
const lit = section.id === active;
return (
@ -101,8 +101,8 @@ export function SectionNav({ sections }: { sections: EditorSection[] }) {
aria-current={lit ? "location" : undefined}
className={`-ml-px flex w-full items-center gap-1.5 border-l-2 px-3 py-1.5 text-left text-sm transition-colors ${
lit
? "border-[#138ba0] font-semibold text-[#0f7183]"
: "border-transparent text-[#4a6b72] hover:border-[#138ba0]/40 hover:text-[#0f7183]"
? "border-brand font-semibold text-link"
: "border-transparent text-muted hover:border-brand/40 hover:text-link"
}`}
>
<Label section={section} />
@ -120,13 +120,13 @@ export function SectionJump({ sections }: { sections: EditorSection[] }) {
const active = useActiveSection(sections);
return (
<div className="sticky top-0 z-20 -mx-6 mt-4 mb-2 border-b border-[#138ba0]/15 bg-[#f6fbfc]/95 px-6 py-2 backdrop-blur lg:hidden">
<label className="flex items-center gap-3 text-sm text-[#4a6b72]">
<div className="sticky top-0 z-20 -mx-6 mt-4 mb-2 border-b border-brand/15 bg-tint-soft/95 px-6 py-2 backdrop-blur lg:hidden">
<label className="flex items-center gap-3 text-sm text-muted">
<span className="shrink-0">Jump to</span>
<select
value={active ?? ""}
onChange={(e) => jump(e.target.value)}
className="w-full rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-1.5 text-sm text-[#26454c] outline-none focus:border-[#138ba0]"
className="w-full rounded-lg border border-muted/25 bg-surface px-3 py-1.5 text-sm text-body outline-none focus:border-brand"
>
{sections.map((section) => (
<option key={section.id} value={section.id}>