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:
parent
ee61568911
commit
c74ad746f5
70 changed files with 829 additions and 596 deletions
|
|
@ -34,9 +34,10 @@ import { personPhoto } from '../lib/media.ts'
|
|||
import { eventTypeLabel } from '../lib/eventTypes.ts'
|
||||
import { occurrenceLabel, seriesLabel, seriesTimes, upcomingOccurrences } from '../lib/eventSeries.ts'
|
||||
import { capitalize } from '../lib/text.ts'
|
||||
import { accentText, readableOn } from '../lib/color.ts'
|
||||
|
||||
const TEAL = '#0f7183'
|
||||
const BODY = '#4a6b72'
|
||||
const BODY = 'var(--color-muted)'
|
||||
|
||||
/* Billing order. A role missing from here still renders, at the
|
||||
end, under its own name, better than a speaker vanishing
|
||||
|
|
@ -94,7 +95,7 @@ export default function EventDetail() {
|
|||
title: event.theme || 'About',
|
||||
blurb: event.theme ? event.tagline ?? undefined : undefined,
|
||||
accent,
|
||||
background: '#ffffff',
|
||||
background: 'var(--color-surface)',
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6 space-y-8">
|
||||
<Facts event={event} accent={accent} />
|
||||
|
|
@ -145,17 +146,17 @@ export default function EventDetail() {
|
|||
title: 'Upcoming dates',
|
||||
blurb: seriesLabel(event.series, event.starts_on) ?? undefined,
|
||||
accent,
|
||||
background: '#eef9fb',
|
||||
background: 'var(--color-tint)',
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6">
|
||||
<ul className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{upcoming.map((date) => (
|
||||
<li
|
||||
key={date}
|
||||
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) }}>
|
||||
{occurrenceLabel(date)}
|
||||
</p>
|
||||
{times && (
|
||||
|
|
@ -176,7 +177,7 @@ export default function EventDetail() {
|
|||
id: 'people',
|
||||
title: 'Who’s there',
|
||||
accent,
|
||||
background: '#eef9fb',
|
||||
background: 'var(--color-tint)',
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6">
|
||||
<PeopleTiles size="lg" groups={groups} accent={accent} />
|
||||
|
|
@ -191,7 +192,7 @@ export default function EventDetail() {
|
|||
title: 'Presented here',
|
||||
blurb: 'Awards given at this gathering.',
|
||||
accent,
|
||||
background: '#ffffff',
|
||||
background: 'var(--color-surface)',
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6 space-y-6">
|
||||
{event.awards.map((entry, index) => (
|
||||
|
|
@ -201,7 +202,7 @@ export default function EventDetail() {
|
|||
style={{ borderColor: accent }}
|
||||
>
|
||||
<div>
|
||||
<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>
|
||||
|
|
@ -254,7 +255,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
|
|||
className="rounded-full px-3 py-1 font-semibold uppercase tracking-wide"
|
||||
style={{
|
||||
background: event.status === 'cancelled' ? '#b3261e' : accent,
|
||||
color: '#ffffff',
|
||||
color: event.status === 'cancelled' ? '#ffffff' : readableOn(accent),
|
||||
}}
|
||||
>
|
||||
{STATUS_LABEL[event.status] ?? event.status}
|
||||
|
|
@ -269,7 +270,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
|
|||
{event.event_type && (
|
||||
<span
|
||||
className="rounded-full px-3 py-1 font-semibold uppercase tracking-wide"
|
||||
style={{ border: `1px solid ${accent}`, color: accent }}
|
||||
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
|
||||
>
|
||||
{eventTypeLabel(event.event_type)}
|
||||
</span>
|
||||
|
|
@ -288,7 +289,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
|
|||
</span>
|
||||
)}
|
||||
|
||||
<Link to="/retreats" className="ml-auto hover:underline" style={{ color: accent }}>
|
||||
<Link to="/retreats" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
|
||||
All retreats
|
||||
</Link>
|
||||
</div>
|
||||
|
|
@ -314,7 +315,7 @@ function HostList({ hosts, accent }: { hosts: EventHost[]; accent: string }) {
|
|||
<Link
|
||||
to={to}
|
||||
className="font-medium hover:underline"
|
||||
style={{ color: accent }}
|
||||
style={{ color: accentText(accent) }}
|
||||
>
|
||||
{host.name}
|
||||
</Link>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue