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

@ -64,17 +64,17 @@ function DeleteControl({ item, onDeleted }: { item: MediaItem; onDeleted: () =>
type="button"
onClick={ask}
disabled={busy}
className="text-xs text-[#4a6b72] hover:text-[#b3261e]"
className="text-xs text-muted hover:text-danger"
>
Delete
</button>
{error && <p className="mt-1 text-xs text-[#b3261e]">{error}</p>}
{error && <p className="mt-1 text-xs text-danger">{error}</p>}
</>
);
}
return (
<div className="rounded-lg bg-[#fdf3f2] p-2 text-xs text-[#26454c]">
<div className="rounded-lg bg-danger-tint p-2 text-xs text-body">
{uses.length > 0 ? (
<p>
Still used by{" "}
@ -89,15 +89,15 @@ function DeleteControl({ item, onDeleted }: { item: MediaItem; onDeleted: () =>
type="button"
onClick={remove}
disabled={busy}
className="font-medium text-[#b3261e] hover:underline"
className="font-medium text-danger hover:underline"
>
{busy ? "Deleting…" : "Delete for good"}
</button>
<button type="button" onClick={() => setUses(null)} className="text-[#4a6b72] hover:underline">
<button type="button" onClick={() => setUses(null)} className="text-muted hover:underline">
Cancel
</button>
</div>
{error && <p className="mt-1 text-[#b3261e]">{error}</p>}
{error && <p className="mt-1 text-danger">{error}</p>}
</div>
);
}
@ -113,7 +113,7 @@ function CopyPath({ url }: { url: string }) {
setTimeout(() => setCopied(false), 1500);
});
}}
className="text-xs text-[#0f7183] hover:underline"
className="text-xs text-link hover:underline"
>
{copied ? "Copied" : "Copy path"}
</button>
@ -128,8 +128,8 @@ export default function AdminMedia() {
return (
<div>
<div className="flex flex-wrap items-baseline gap-3">
<h1 className="text-2xl font-bold text-[#0f7183]">Media</h1>
<p className="text-sm text-[#4a6b72]">
<h1 className="text-2xl font-bold text-link">Media</h1>
<p className="text-sm text-muted">
Uploaded images. Image fields in every editor pick from here.
</p>
</div>
@ -142,7 +142,7 @@ export default function AdminMedia() {
label="Upload images"
onUploaded={(item) => setItems((current) => [item, ...(current ?? [])])}
/>
<p className="mt-1 text-xs text-[#4a6b72]">{UPLOAD_HELP}</p>
<p className="mt-1 text-xs text-muted">{UPLOAD_HELP}</p>
</div>
)}
<input
@ -150,15 +150,15 @@ export default function AdminMedia() {
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search by file name"
className="ml-auto w-64 rounded-lg border border-[#4a6b72]/25 px-3 py-2 text-sm outline-none focus:border-[#138ba0]"
className="ml-auto w-64 rounded-lg border border-muted/25 px-3 py-2 text-sm outline-none focus:border-brand"
/>
</div>
<div className="mt-6">
{error ? (
<p className="text-sm text-[#b3261e]">{error}</p>
<p className="text-sm text-danger">{error}</p>
) : items === null ? (
<p className="text-sm text-[#4a6b72]">Loading…</p>
<p className="text-sm text-muted">Loading…</p>
) : (
<MediaGrid
items={items}
@ -169,7 +169,7 @@ export default function AdminMedia() {
href={item.url}
target="_blank"
rel="noreferrer"
className="text-xs text-[#0f7183] hover:underline"
className="text-xs text-link hover:underline"
>
Open
</a>