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

@ -31,9 +31,10 @@ import {
} from '../lib/useContent.ts'
import { orgHref, orgListHref, teamHref } from '../lib/hrefs.ts'
import { orgLogo, personPhoto } from '../lib/media.ts'
import { withAlpha, accentText } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
export default function OrganizationDetail() {
const { id } = useParams()
@ -78,7 +79,7 @@ export default function OrganizationDetail() {
id: 'about',
title: 'About',
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-8">
<Facts org={org} accent={accent} back={back} />
@ -106,7 +107,7 @@ export default function OrganizationDetail() {
id: 'leadership',
title: 'Who runs it',
accent,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-12">
{teamBlocks.map((block) => (
@ -117,14 +118,14 @@ export default function OrganizationDetail() {
<Link
to={teamHref(block.teamId)}
className="hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{block.label}
</Link>
</h3>
) : (
block.label && (
<h3 className="text-xl font-bold" style={{ color: accent }}>
<h3 className="text-xl font-bold" style={{ color: accentText(accent) }}>
{block.label}
</h3>
)
@ -168,19 +169,19 @@ export default function OrganizationDetail() {
title: 'Chapters',
blurb: org.details.map_note ?? undefined,
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{(org.details.chapters ?? []).map((chapter) => (
<Link
key={chapter.id}
to={orgHref(chapter.id, 'chapter')}
className="flex items-center gap-4 rounded-lg border p-4 transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: `${accent}40` }}
className="flex items-center gap-4 rounded-lg border p-4 transition-colors hover:bg-tint"
style={{ borderColor: `${withAlpha(accent, 25)}` }}
>
<Logo file={chapter.logo} name={chapter.name} accent={accent} />
<span>
<span className="block font-semibold" style={{ color: accent }}>
<span className="block font-semibold" style={{ color: accentText(accent) }}>
{chapter.name}
</span>
{chapter.location_label && (
@ -202,17 +203,17 @@ export default function OrganizationDetail() {
title: 'Awards',
blurb: `Given by ${org.short_name || org.name}.`,
accent,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="max-w-6xl mx-auto px-6 grid gap-4 sm:grid-cols-2">
{org.awards.map((award) => (
<Link
key={award.id}
to={`/awards/${award.id}`}
className="rounded-lg border bg-white p-5 transition-colors hover:bg-[#f6fbfc]"
style={{ borderColor: `${accent}40` }}
className="rounded-lg border bg-surface p-5 transition-colors hover:bg-tint-soft"
style={{ borderColor: `${withAlpha(accent, 25)}` }}
>
<span className="block font-semibold" style={{ color: accent }}>
<span className="block font-semibold" style={{ color: accentText(accent) }}>
{award.name}
</span>
{award.description && (
@ -246,7 +247,7 @@ export default function OrganizationDetail() {
id: 'events',
title: 'Gatherings',
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<EventListCards
host={org.id}
@ -304,7 +305,7 @@ function Facts({
)}
{org.is_online && <span style={{ color: BODY }}>Online</span>}
<Link to={back.to} className="ml-auto hover:underline" style={{ color: accent }}>
<Link to={back.to} className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
{back.label}
</Link>
</div>
@ -347,8 +348,8 @@ function Contact({ org, accent }: { org: OrganizationRecord; 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}