Design system — "Ecclesia Digitalis"
Rendered from churchix/corpus/wiki/design-system.md · updated 2026-11-02.
This page is generated from churchix's own docs and rewritten on every docs build. Edit the source in churchix/, not here.
The visual layer of every church site. It lives in @churchix/ui and re-skins per church by token swap only — components never fork. The design is reverent, formal, architectural — a "Digital Iconostasis" that frames sacred content with restraint (tonal layers + 1px outlines over heavy shadows; gold as a sparing accent).
Source & decision
- Raw source: docs/design/DESIGN.md (the
Ecclesia Digitalistoken spec) + four reference screens underdocs/design/stitch_churchix_white_label_design_system/(Home, Program Slujbe, Pomelnice, Donate), generated by Stitch. - Decision: ADR-0002 — adopt Tailwind + the full Material-3 token palette, superseding ADR-0001 (which proposed a bounded plain-CSS "safe set"). ADR-0001 was the brief; ADR-0002 accepts the output.
- Implementation work: a design-integration programme of 17 work items brought the system into
@churchix/uiand the app, built 2026-05-29 and closed 2026-10-07; log.md has an entry per item. Where it stands: status.
The token contract
- A Material-3 palette (~50 color roles:
primary,on-primary,primary-container,secondary,surface,surface-container-{lowest…highest},outline,outline-variant,error, the*-fixedset, …), an M3 type scale (display-lg,headline-lg,body-md,label-md,caption, plus the redesign'sdisplay-xlandoverline; Cardo headings with Source Serif 4 as the fallback, Inter body), named spacing (base/xs/sm/md/lg/xl/gutter/container-max), and a radius scale. - Roles are CSS custom properties wired into the Tailwind theme (
bg-primary→var(--primary)). - Churches set only a small seed set —
primary,secondary(gold),surface(and optionalerror/fonts/radius) — in theirsitecontent entry (siteSchema.brand). The remaining roles are derived in the base layer, not hand-set per church. This preserves ADR-0001's anti-sprawl spirit: the church-facing surface stays tiny even though the system uses the full palette. - Brand tokens are emitted as a
:root{…}block byBaseLayout(packages/ui/src/layouts/BaseLayout.astro) from the church's content — so a church rebrands by editing content, not code. This is the mechanism behind the independence-model.
Tradition as a variant
v1 ships the Orthodox theme (burgundy #4e0816/#6b1f2a, gold seed #c8a24b, warm cream #fcf9f4). The same components accept an evangelical variant later (warmer palette, sans headings, photography-forward) purely by swapping tokens + the tradition flag — no new components. See traditions.
Hard constraints (every component)
- No raw hex / no hardcoded church values in
packages/*— always go through a token. - WCAG AA across the realistic token range; gold is decorative, never body text on light.
- Romanian diacritics render correctly; layouts survive long DE/RO strings. See i18n-and-glossary.
- Astro static-first + React islands; hydrate only genuinely interactive bits. See architecture.
- Money always shows explicit currency (integer minor units internally). See donations.
Seed vs derived tokens (the brand contract)
A church re-skins by setting a small seed set in site.brand; BaseLayout emits only those seeds as a :root{…} block, and the rest of the ~50 M3 roles are derived from them via color-mix() in packages/ui/src/styles/tokens.css. The same table is mirrored as a comment at the top of that file.
| Seed (church-settable) | site.brand field | Derives |
|---|---|---|
--primary (burgundy) | primary (req) | --primary-container, --on-primary-container, --inverse-primary, --primary-fixed(+dim), --on-primary-fixed(+variant), --surface-tint, --outline-variant |
--secondary (gold) | secondary (req; was accent) | --on-secondary, --secondary-container, --on-secondary-container, --secondary-fixed(+dim), --on-secondary-fixed(+variant) |
--surface (cream) | surface (opt) | --background, --surface-dim/-bright/-variant, --surface-container-{lowest…highest}, --on-surface(-variant), --on-background, --outline |
--error | error (opt) | --on-error, --error-container, --on-error-container |
--on-primary | onPrimary (opt) | — |
--font-heading / --font-body / --radius | fontHeading / fontBody / radius (opt) | — |
Fixed (not seed-driven): the tertiary neutral family + --inverse-surface/--inverse-on-surface use DESIGN.md literals. color-mix() ships in all evergreen browsers (2023+); a church needing pixel-exact tones sets the seed directly — derivation never blocks a build.
AA contrast (default Orthodox palette, verified): primary #4e0816 on cream #fcf9f4 = 14.6:1; primary-container #6b1f2a = 10.8:1; on-surface = 16.3:1; on-surface-variant = 8.9:1; white-on-primary = 15.3:1; error = 6.2:1 — all pass AA text. Gold flag: the church gold seed (#c8a24b, the --secondary default in tokens.css) is only 2.2:1 on cream — it MUST stay decorative (dividers, ≥3px borders, fills behind on-secondary), never body text on light. The DESIGN.md token gold #785a02 passes (6.1) but is darker than the #c8a24b seed the audit adopted on 2026-05-30.
The 2026-06-18 redesign ("liturgical rail")
Commit 70999ff rebuilt the visual identity on the same token contract. The one move is the liturgical week as a vertical spine.
- Rail — a thin gold vertical rule with day/feast diamond markers down the left margin of a content column. Decorative (
aria-hidden), built only from--secondaryand--outline-variant, so it adds structure and no palette. Collapses to a hairline on mobile. - PageShell — the inner-page frame: overline kicker, display title, lede and a gold rule, left-aligned, with the Rail beside the body and an optional
actionsslot. It wrapsmax-w-container-max mx-auto px-sm md:px-gutterand is used by every inner page except the 404 (ErrorLayout) and the announcement detail page, which sets the same container itself. The home page also sets its own sections. - Hero — an asymmetric split. Left is the identity (overline, church name in
display-xl, the live "next service", CTAs). Right is a framed image above a quiet "this week" timeline built from the schedule. It degrades with no image (tonal burgundy panel and glyph), no schedule or no next service. - Type tokens in theme.css:
display-xl(clamped 2.75 to 4.5rem, the hero name) andoverline(11px, 0.22em tracking, the formal micro-label used by PageShell, SectionHeading and Footer). - Header's active nav uses an animated gold underline. SectionHeading gained an optional kicker and a gold rule. Light-surface eyebrows use
on-secondary-container(AA-safe), not the palesecondary-fixed, which only clears contrast on the dark burgundy band.
Component & page inventory
Global chrome (Header with language switcher and Donează CTA, Footer, SectionHeading, Divider, Rail, PageShell), primitives (Button, Card, Badge, Field, Alert, EmptyState, Icon), feature components (Hero, ServiceSchedule, AnnouncementList, CampaignCard, GivingChannels) and the 10 pages of apps/parohia-harlesti-bacau: home, program, anunturi list and detail, donatii, pomelnice, contact, despre, 404.
Home (index.astro) is now the asymmetric Hero, then an announcements section on the Rail (a wide lead card plus up to three stacked smaller cards, pinned first), then a quiet burgundy "despre" band with a quick-facts list (hram, eparhie, Sfânta Liturghie). It is no longer hero, announcements strip and Program + About bento (brief 07, superseded). The original inventory is in ADR-0001 §3; the build breakdown is in status.
Tailwind max-w-* guard
In this theme bare max-w-sm|md|lg|xl bind to the spacing scale (max-w-xl is 4rem) and collapse layouts; see the note in theme.css. Use max-w-2xl and up, or max-w-[NNrem]. packages/ui/scripts/check-max-w.mjs fails on a bare class in .astro, .tsx and .ts under apps/ and packages/, and runs in npm run lint through the @churchix/ui lint script. Variants such as sm:max-w-md are not flagged. The container itself is max-w-container-max (1200px, --spacing-container-max).
Empty-state pattern
Anywhere a list can render zero items (announcements, campaigns, schedule, events, gallery), the page must fall back to the shared EmptyState primitive (@churchix/ui/components/EmptyState.astro) rather than rendering an empty container or a bespoke message. This keeps the "graceful degradation" look identical across every church and re-skins by token alone. The pattern:
---
import EmptyState from '@churchix/ui/components/EmptyState.astro';
import Button from '@churchix/ui/components/Button.astro';
const items = (await getCollection('announcements')).map((e) => e.data);
---
{items.length === 0 ? (
<EmptyState icon="push_pin" title="Niciun anunț momentan"
message="Reveniți curând pentru noutățile parohiei.">
<Button slot="cta" variant="secondary" href="/program">Vezi programul</Button>
</EmptyState>
) : (
<AnnouncementList items={items} />
)}
Guidance: pick a list-appropriate icon (push_pin/announcements, campaign/campaigns, schedule/program, event/events), keep the title reverent and Romanian, and only attach a cta slot when there's a genuinely useful next step. The CTA uses the secondary Button variant inside lists (the page already has its primary action elsewhere); list pages own the empty-vs-populated branch, the primitive owns the visuals.
Error pages reuse the same primitive. The shared ErrorLayout (@churchix/ui/layouts/ErrorLayout.astro) composes BaseLayout chrome (per-church Header/Footer + brand tokens) around an EmptyState with a church/diversity_1 illustration, a quiet gold status-code eyebrow, and a primary "Înapoi la pagina principală" Button. Each app's src/pages/404.astro loads its site config and renders <ErrorLayout site={site} />; reverent Romanian defaults ("Pagina nu a fost găsită") live in the component and are overridable via title/message/code/icon props. Astro emits it as a static 404.html that the CDN/host serves on unknown paths.
Generic 500 / server-error page is N/A for static SSG. With the static-per-build deploy target (no Astro adapter), there is no server route to render a 500.astro; runtime 5xx is handled by the host/CDN, not our code. If a church later adopts an on-demand adapter (the optional escape hatch), it can add a 500.astro that reuses ErrorLayout with code="500" and an error-tone message — the composition already supports it.
Reference-app rollout & visual-QA deviations (2026-05-29)
The one app, apps/parohia-harlesti-bacau, is fully on the M3 system; every page (index, program, anunturi list+detail, donatii, pomelnice, contact, despre, 404) uses the shared chrome + primitives. Its brand seeds are --primary:#6b1f2a (burgundy) / --secondary:#c8a24b (gold). A second reference app (Berinta, blue) existed at the time of the rollout and was removed before 2026-05-30, so the white-label claim now rests on the token chain, not on a second site. Colors flow only through the text-primary → --color-primary → --primary → :root seed token chain, so a re-skin is a site.json brand edit with no code change and no hex in page markup beyond the per-church :root seed block.
Open (found 2026-10-23): in the built pages the seeds don't win. BaseLayout.astro writes the :root seed block before the stylesheet that carries tokens.css's own :root defaults, so the parish renders #4e0816, not #6b1f2a, and a second brand's seeds change nothing until this is fixed (todo).
Contact = SectionHeading + a parish-data Card (church icon, <dl> with tel/mailto links) + a Card-framed mapEmbedUrl iframe + a candle-icon prayer-request form (Field × Nume/Email/Mesaj + primary Button). The form is server-light: it mailto:-submits when the church email is set, else a plain method=post placeholder — no backend is assumed (PCI/independence-safe). Despre = diacritic-safe .cx-prose (line-height 1.75, token-colored h2) + an optional leadership grid ordered by staff.order.
The staff collection (shared staffSchema) is optional: registered in the app's content.config.ts, seeded with placeholder Preot paroh / Consiliul entries; empty or absent → despre renders prose only.
Intentional deviations from the Stitch reference screens (all reviewed):
- Prayer-form submit uses a trailing
sendicon; the Stitch pomelnice mock shows a leading icon. Kept trailing to match the Button convention used elsewhere. - Despre has no dedicated Stitch screen — it follows the donate/announcement card+prose language for consistency.
- Leadership cards use a
person-glyph circular avatar placeholder (seed data carries nophoto); a real photo, when supplied, can replace the glyph later.
Accessibility (WCAG AA) — contract & audit (2026-05-29)
The system holds WCAG 2.1 AA across the realistic brand range. Verified with axe-core 4 (Playwright) on both reference apps' key pages at the time — 0 critical/serious/moderate violations.
Contrast contract (computed for the Harlesti burgundy #6b1f2a seed and the Berinta blue #1e3a5f seed it was first checked against):
| Pair | Ratio | Use |
|---|---|---|
primary on surface | ~10.5:1 | headings, links |
on-surface on surface | ~15.8:1 | body |
on-surface-variant on surface | ~8.7:1 | muted body/labels |
on-primary on primary | ~11.3:1 | buttons, dark bars |
secondary-fixed (gold) on primary | ~9.3:1 | Hero eyebrow on dark |
on-secondary-container on the gold chip | ~9.6:1 | Badge/Alert (after fix) |
on-primary-container on the primary chip | ~10:1 | Badge/Alert (after fix) |
Gold rule (enforced): secondary (gold, ~#c8a24b/#c9a227) is 2.2:1 on cream — never body or label text on a light surface, and never the focus ring on a light surface (fails WCAG 2.1 AA non-text contrast §1.4.11). Gold appears only as fills, borders, dividers, decorative icons, progress fills, and as light secondary-fixed text on the dark primary Hero. Focus rings on light surfaces use burgundy --primary (focus-visible:ring-primary); gold rings only on the dark hero (where ratio is ~6.4:1). The on-*-container "on" tones are derived dark (color-mix(seed 30%, #000)), per M3 semantics.
Semantics: exactly one <h1> per page (page title; SectionHeading as="h1" / EmptyState as="h1" on title-bearing empty/error states), valid heading order (footer section headings are h2, the IBAN sub-block h3), one <main> landmark (provided by BaseLayout — pages must not nest their own), role="progressbar" + aria-value* on the CampaignCard thermometer, labelled form fields with aria-describedby hints and role="alert"/aria-live errors, aria-current on the active nav item.
Keyboard/focus: a token-driven skip-to-content link (#main) leads the tab order; every interactive element (nav, language switcher, MobileNav sheet + its focus trap/Esc-restore, CopyIban, donate presets, PomelnicForm, all CTAs, footer links) is reachable with a visible burgundy focus-visible:ring-primary ring on light surfaces (~14.6:1); gold rings (ring-secondary) are used only on the dark burgundy hero where the offset gives ~6.4:1.
Phone menu (since 2026-10-23): packages/ui/src/islands/MobileNav.tsx is a Base UI Dialog. The toggle is the trigger and keeps its changing aria-label; the sheet is the popup, rendered as the <nav>, portalled into the island's own relative wrapper so it still hangs under the toggle. The toggle (an X when open), Esc and a press outside close it. Nav and locale links close it through a leftByLink ref, so focus goes where the link went instead of back to the toggle. Base UI also locks the page's scroll, which the hand-built menu never did.
i18n externalization points: chrome strings live in .astro/island props with RO defaults (nav labels from site.nav, Donează/locale names/skipToContentLabel/localeLabel as overridable props); page/content strings come from content collections; money renders via Intl.NumberFormat with an explicit currency from integer minor units, dates via Intl.DateTimeFormat. Liturgical RO terms staying RO inside EN pages is intended, not a defect.
Long strings: verbose RO/DE labels wrap (desktop nav is flex-wrap min-w-0); IBANs break-all; no fixed-width text container clips.