Themes
View SourceThe public site is a theme, and a theme is two things: a layout (its
structure and templates) and a skin of design tokens (fonts, palette,
radius, measure). Six layouts ship, each a directory under
lib/wraith_web/themes/layouts/<layout>/ with a module
(use WraithWeb.Theme.Layout, name: "<layout>") and four HEEx templates —
layout, index, post, and a shared listing (tag/author/search). The
subscribe and member pages, the search box, the mode toggle and social
links are shared by every layout from WraithWeb.Themes.Shared.
Each layout carries three skins, so 18 themes ship:
| Layout | Themes |
|---|---|
| editorial — masthead, lead story, card feed | paper (default), broadsheet, gallery |
| list — dated rows, narrow column | ink, ledger, terminal |
| grid — centred logo, image-first cards | studio, polaroid, slate |
| magazine — hero + sidebar | review, weekend, tabloid |
| minimal — one narrow column | plain, mono, zen |
| journal — dated entries, date in the margin | diary, letters, nightshift |
A theme module is tiny — a name, a layout, a Google Fonts URL and a tokens
map:
use WraithWeb.Theme,
name: "broadsheet", label: "Broadsheet", description: "…",
layout: WraithWeb.Themes.Layouts.Editorial,
fonts: "https://fonts.googleapis.com/css2?family=Playfair+Display…",
tokens: %{"--heading" => "'Playfair Display', serif", "--accent" => "#b00020", …}The root layout links /themes/base.css (everything the layouts share) and
/themes/layouts/<layout>.css, loads the theme's fonts, and inlines the
tokens as CSS variables on :root. The widget classes and prose styles come
from app.css. Pick a theme in Settings → Theme (a gallery of swatches
grouped by layout) or over MCP (settings_update, themes_list); your site
accent colour overrides the theme's. Dark skins declare --scheme: dark, and
light skins get a sensible dark palette from the reader's prefers-color-scheme
or the light/dark toggle.
Themes are compiled into the release, by design: no template code is loaded at runtime. Ghost (Handlebars) theme compatibility would be a second theme kind on top of this contract; it is not there yet.