Skip to content

Selectable themes, each a palette and a typeface - #8

Merged
davertor merged 1 commit into
mainfrom
feat/themes
Sep 9, 2026
Merged

davertor merged 1 commit into
mainfrom
feat/themes

Conversation

@davertor

@davertor davertor commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

TLDR: Adds eight themes the reader can switch between, each defining its own palette, typeface and paper. A note carries only the values it was rendered with, so adding a theme later never leaves notes on disk stale.

Switching themes on the same note

The same note in all nine themes. The palette, the typeface, the paper and the corners all come from the theme; the composition never moves.

  • scripts/themes.py — one source of truth for colour and type. Each theme declares 12 colour tokens, a scheme, grain, radius, border, paper texture, and a type stack (display / body / label faces plus weight, variable axes and tracking).
  • Notes carry values, not a catalogue. palette_css resolves one theme into a single :root; auto is the only one that needs the light/dark pair. Nothing in a note names a theme, so a theme added years from now cannot make it stale.
  • Live switching from a menu in the gallery's filter bar, remembered per browser. The gallery holds the catalogue and passes a value set to a note through the card's link, so an archive written in one theme reads in another — including themes that did not exist when the note was written.
  • Eight themes: four in the house serif (paper, field, blueprint, graphite), plus bureau, acid, barbie, petrol and notebook, each with its own faces. Accents span seven hues where the shipped design had one.
  • Contrast is enforced, not assumed. --selftest asserts WCAG AA for every text token against its own paper, for text on bands and highlights, that the two muted tiers are tellable apart, and that a stack's display weight is one its family actually loads.
  • Fixes two contrast bugs this surfaced: the poster chip was a literal #fff on the accent (2.25:1 on the darkest theme) and is now --paper; print overrides use !important so an injected theme cannot print in colour.
  • Templates take the palette through tokens: hardcoded font families, weights, axes, label casing, border weights and corner radii are now theme-controlled.
  • Adds themes to the CI selftest loop, and marketplace.json to the version cross-check it had drifted out of.

Genres (field-guide and recipe layouts) build on this and land separately.

A theme is a palette and a type stack. A rendered note carries only the
values it was made with, resolved into one :root block — never the list of
themes that exist — so a theme added later cannot leave a note on disk
stale. The gallery holds the catalogue and hands a note a different value
set through the card's link, which the note applies without learning a name.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@davertor
davertor merged commit 7f017aa into main Sep 9, 2026
1 check passed
@davertor
davertor deleted the feat/themes branch September 9, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant