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

@ -34,9 +34,9 @@ function NavCard({ item }) {
const extras = (item.children ?? []).filter((child) => child.to !== to);
return (
<div className="group relative flex flex-col rounded-2xl border border-[#138ba0]/20 bg-white p-5 transition-all hover:border-[#138ba0]/60 hover:shadow-sm">
<div className="group relative flex flex-col rounded-2xl border border-brand/20 bg-surface p-5 transition-all hover:border-brand/60 hover:shadow-sm">
<div className="flex items-baseline gap-3">
<h3 className="text-base font-semibold text-[#0f7183]">
<h3 className="text-base font-semibold text-link">
<Link
to={to}
className="after:absolute after:inset-0 after:rounded-2xl after:content-['']"
@ -46,23 +46,23 @@ function NavCard({ item }) {
</h3>
<span
aria-hidden="true"
className="ml-auto text-[#0f7183] opacity-0 transition-opacity group-hover:opacity-100"
className="ml-auto text-link opacity-0 transition-opacity group-hover:opacity-100"
>
→
</span>
</div>
{item.blurb && (
<p className="mt-1.5 text-sm leading-relaxed text-[#4a6b72]">{item.blurb}</p>
<p className="mt-1.5 text-sm leading-relaxed text-muted">{item.blurb}</p>
)}
{extras.length > 0 && (
<div className="relative z-10 mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t border-[#138ba0]/10 pt-3 text-sm">
<div className="relative z-10 mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t border-brand/10 pt-3 text-sm">
{extras.map((child) => (
<Link
key={child.to}
to={child.to}
className="text-[#4a6b72] underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
className="text-muted underline-offset-4 transition-colors hover:text-link hover:underline"
>
{child.label}
</Link>
@ -77,8 +77,8 @@ function CardBlock({ title, blurb, children }) {
return (
<div className="mt-10">
<div className="flex items-baseline gap-3">
<h2 className="text-lg font-semibold text-[#0f7183]">{title}</h2>
{blurb && <p className="text-sm text-[#4a6b72]">{blurb}</p>}
<h2 className="text-lg font-semibold text-link">{title}</h2>
{blurb && <p className="text-sm text-muted">{blurb}</p>}
</div>
<div className="mt-4 grid gap-4 sm:grid-cols-2">{children}</div>
</div>
@ -87,11 +87,11 @@ function CardBlock({ title, blurb, children }) {
function PanelSection({ title, children }) {
return (
<section className="border-b border-[#138ba0]/10 px-5 py-4 last:border-b-0">
<h2 className="text-xs font-semibold uppercase tracking-wider text-[#4a6b72]/70">
<section className="border-b border-brand/10 px-5 py-4 last:border-b-0">
<h2 className="text-xs font-semibold uppercase tracking-wider text-muted/70">
{title}
</h2>
<div className="mt-2.5 text-sm text-[#4a6b72]">{children}</div>
<div className="mt-2.5 text-sm text-muted">{children}</div>
</section>
);
}
@ -114,10 +114,10 @@ export default function AdminHome() {
return (
<div className="grid gap-8 lg:grid-cols-[1fr_17rem] lg:items-start">
<div>
<h1 className="text-2xl font-bold text-[#0f7183]">
<h1 className="text-2xl font-bold text-link">
{user?.name ? `Welcome back, ${user.name.split(" ")[0]}.` : "Welcome back."}
</h1>
<p className="mt-1 text-[#4a6b72]">Pick a section to work in.</p>
<p className="mt-1 text-muted">Pick a section to work in.</p>
{GROUPS.map((group) => (
<CardBlock key={group.label} title={group.label} blurb={group.blurb}>
@ -137,14 +137,14 @@ export default function AdminHome() {
</div>
{/* Sticky so it stays put once the card column outgrows it. */}
<aside className="divide-y divide-[#138ba0]/10 rounded-2xl border border-[#138ba0]/20 bg-white lg:sticky lg:top-6">
<aside className="divide-y divide-brand/10 rounded-2xl border border-brand/20 bg-surface lg:sticky lg:top-6">
<PanelSection title="Signed in">
<p className="font-medium text-[#0f2f36]">{user?.name || user?.email}</p>
{user?.name && user?.email && (
<p className="mt-0.5 break-all text-xs text-[#4a6b72]/80">{user.email}</p>
<p className="mt-0.5 break-all text-xs text-muted/80">{user.email}</p>
)}
{role && (
<span className="mt-2 inline-block rounded-full bg-[#eef9fb] px-2.5 py-0.5 text-xs font-medium text-[#0f7183]">
<span className="mt-2 inline-block rounded-full bg-tint px-2.5 py-0.5 text-xs font-medium text-link">
{role}
</span>
)}
@ -156,7 +156,7 @@ export default function AdminHome() {
<li key={link.to}>
<Link
to={link.to}
className="underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
className="underline-offset-4 transition-colors hover:text-link hover:underline"
>
{link.label}
</Link>
@ -166,12 +166,12 @@ export default function AdminHome() {
</PanelSection>
<PanelSection title="Site">
<p className="font-mono text-xs text-[#4a6b72]/80">{SITE_VERSION}</p>
<p className="font-mono text-xs text-muted/80">{SITE_VERSION}</p>
<a
href="/"
target="_blank"
rel="noreferrer"
className="mt-2 inline-block underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
className="mt-2 inline-block underline-offset-4 transition-colors hover:text-link hover:underline"
>
View the public site ↗
</a>