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,10 +34,11 @@ import { awardHref, eventHref, orgHref, teamHref } from '../lib/hrefs.ts'
import { initials, personPhoto } from '../lib/media.ts'
import { eventTypeLabel } from '../lib/eventTypes.ts'
import { capitalize } from '../lib/text.ts'
import { accentText } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BACKGROUNDS = ['#ffffff', '#eef9fb']
const BODY = 'var(--color-muted)'
const BACKGROUNDS = ['var(--color-surface)', 'var(--color-tint)']
/* affiliations.role, for a row with no title of its own. */
const ROLE_LABEL: Record<string, string> = {
@ -110,7 +111,7 @@ export default function PersonDetail() {
{previous.length > 0 && (
<div>
{current.length > 0 && (
<h3 className="mb-4 text-lg font-semibold" style={{ color: accent }}>
<h3 className="mb-4 text-lg font-semibold" style={{ color: accentText(accent) }}>
Previously
</h3>
)}
@ -156,7 +157,7 @@ export default function PersonDetail() {
className="border-l-2 pl-5"
style={{ borderColor: accent }}
>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
<Link to={awardHref(entry.award.id)} className="hover:underline">
{entry.award.name}
</Link>
@ -170,7 +171,7 @@ export default function PersonDetail() {
<Link
to={eventHref(entry.event.id)}
className="hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{entry.event.title}
</Link>
@ -226,7 +227,7 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
<Link
to={orgHref(person.org.id, person.org.kind)}
className="font-medium hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{person.org.name}
</Link>
@ -234,7 +235,7 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
{person.location_label && <span style={{ color: BODY }}>{person.location_label}</span>}
<Link to="/leadership" className="ml-auto hover:underline" style={{ color: accent }}>
<Link to="/leadership" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
Leadership
</Link>
</div>
@ -274,8 +275,8 @@ function Contact({ person, accent }: { person: PersonRecord; accent: string }) {
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: accent, color: accent }}
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-tint"
style={{ borderColor: accent, color: accentText(accent) }}
>
<PlatformIcon platform={link.platform} />
{link.label}
@ -293,10 +294,10 @@ function RoleList({ roles, accent }: { roles: PersonRole[]; accent: string }) {
{roles.map((role, index) => (
<li
key={`${role.org.id}:${role.team?.id ?? ''}:${role.title ?? role.role}:${index}`}
className="rounded-xl border-l-4 bg-white px-5 py-3"
className="rounded-xl border-l-4 bg-surface px-5 py-3"
style={{ borderColor: accent }}
>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
{role.title || ROLE_LABEL[role.role] || capitalize(role.role)}
</p>
<p className="text-sm" style={{ color: BODY }}>
@ -344,7 +345,7 @@ function EventRow({ event, accent }: { event: PersonEvent; accent: string }) {
return (
<div className="border-l-2 pl-5" style={{ borderColor: accent }}>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
<Link to={eventHref(event.id)} className="hover:underline">
{event.title}
</Link>