Skip to content

docs: theme readability audit + generate base16 CSS from tinted-theming/schemes - #111

Merged
vito merged 5 commits into
mainfrom
theme-whitelist-readability
Jun 11, 2026
Merged

vito merged 5 commits into
mainfrom
theme-whitelist-readability

Conversation

@vito

@vito vito commented Jun 11, 2026 •

Copy link
Copy Markdown
Owner

Started as docs feedback (papercolor-light rendering green-on-red on the landing page) and grew into a full cleanup of the theme system. Three parts:

1. Readability audit of the rotation

The site maps base16 slots to roles in page.tmpl: base00 is the page background, base04 colors most prose, base01/base02 are secondary backgrounds (sidebar, ::selection, inline p code chips), base08–0F are syntax foregrounds. papercolor-light repurposes base01/base02 as pure red/green, hence the carnage (sidebar text 1.8:1, inline code 1.14:1).

A scripted WCAG contrast audit of every curated scheme against those actual role pairs cut ten themes. Criteria: broken secondary backgrounds, prose below 3:1, type tokens below 2:1, inline-code chips below 2:1.

  • Light: papercolor-light, edge-light (same disease — green sidebar), github (prose 1.23:1, near-invisible #e8e8e8 on white), tomorrow + google-light (prose 2.9:1), default-light + classic-light + humanoid-light (type tokens 1.4–1.7:1), solarized-light (inline code 1.67:1)
  • Dark: catppuccin (deprecated pre-flavor-split port; prose 2.2:1)

Themes that only miss on intentionally-muted comments were kept — that's a design choice, not a defect. The cuts stay selectable in the dropdown; only the random roll is curated, and stale session rolls re-roll automatically. To restore some light-list depth, equilibrium-gray-light was backfilled immediately and dirtysea + tokyo-city-light were added on review, leaving the rotation at 32 dark / 10 light going into part 3.

2. Generate the CSS instead of vendoring it

The ~200 vendored CSS files were a years-old snapshot with no upgrade path — how the dead catppuccin port and duplicate slugs (ir-black/irblack) lingered. Now tinted-theming/schemes is pinned as the docs/schemes submodule and cmd/genthemes generates the CSS at build time. base24 schemes are mapped down to their base16 subset (base00–0F semantics are identical; base10–17 only add bright terminal variants the site never uses), growing the switcher to 452 schemes including the modern catppuccin flavors. Slugs that upstream deleted or renamed (catppuccin, ir-black, seti-ui, …) drop out of the dropdown; readers with a stale saved choice fall back to the no-JS palette in chroma.css until they re-pick. build.sh initializes the submodule itself if missing, so plain clones still build. Verified working on the Cloudflare preview.

3. Rotate in every passing scheme from the bigger pool

Re-running the audit over the full generated pool, the rotation gains 23 schemes: 14 arrivals new with the submodule, plus 9 long-available passers that had never been curated.

  • Light (10 → 15): alucard (Dracula's official light variant), charcoal-light, kissa-latte, measured-light, precious-light-white — more than restores the depth the cuts took from the light list
  • Dark (32 → 50): chinoiserie-night, da-one-black, everforest, kissa-macchiato, measured-dark, penumbra-dark-contrast-plus-plus, precious-dark-eleven, eldritch, spaceduck, plus the long-available passers ashes, bright, danqing, gigavolt, google-dark, harmonic16-dark, helios, ia-dark, and windows-10

The measured and penumbra families are designed around contrast accessibility, fittingly. Near-misses (readable except muted comments) were left out. Multi-variant families contribute one variant each — picked by most contrast headroom on their worst role pair — so they don't dominate the random roll.

Audit re-run over the final 65-theme rotation, parsed straight from the lists in switcher.js: zero failures.

🤖 Generated with Claude Code

Reader feedback flagged papercolor-light as hideous on the docs site:
it repurposes base01/base02 as pure red/green, and the site uses those
slots as the sidebar, selection, and inline-code backgrounds, yielding
blue-on-red sidebar text at a 1.8:1 contrast ratio.

Auditing every curated scheme against page.tmpl's role mapping (WCAG
contrast of base04 prose and base08-0F syntax on base00, plus text over
the base01/base02 secondary backgrounds) surfaced more offenders, so
the rotation loses them too: edge-light shares the papercolor disease
(green sidebar, orange selection); github paints prose at 1.23:1
(base04 is #e8e8e8 on white); google-light and tomorrow set prose
below 3:1; default-light, classic-light, and humanoid-light render
type tokens at 1.4-1.7:1; solarized-light's base02 is a foreground
gray, leaving inline-code chips at 1.67:1; and the deprecated
catppuccin port sets prose at 2.2:1. equilibrium-gray-light passes
every check and joins its three siblings to round the light list back
out. All schemes remain selectable from the dropdown; only the random
roll is curated.

Signed-off-by: Alex Suraci <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

vito added 2 commits June 11, 2026 16:10
dirtysea and tokyo-city-light both pass the same contrast audit that
trimmed the light rotation (dirtysea passes every pair; tokyo-city-
light only misses on intentionally-muted comment text, matching the
profile of schemes already curated), so they fatten the light list
back up to ten without reintroducing any readability problems.

Signed-off-by: Alex Suraci <[email protected]>
The ~200 per-scheme CSS files under docs/css/base16 were a years-old
vendored snapshot of the base16 ecosystem with no upgrade path, which
is how a deprecated catppuccin port and stale palettes lingered. Pin
tinted-theming/schemes (the registry that succeeded chriskempson's
base16-schemes) as a submodule at docs/schemes and generate the CSS at
build time with a new cmd/genthemes command instead. build.sh
initializes the submodule itself when it's missing, so clones that
skipped --recurse-submodules still build.

base24 schemes are generated too: base00-base0F keep base16 semantics
there (base10-base17 only add bright terminal variants the site never
uses), so mapping them down is free and grows the switcher from ~200
to 452 schemes, including the four modern catppuccin flavors. When a
name exists in both systems the base16 version wins. The generated
file naming (base16-<name>.css) is unchanged, so readers' persisted
choices keep resolving; the handful of upstream renames (ir-black to
irblack, seti-ui to seti, solar-flare to solarflare) fall back to the
no-JS palette in chroma.css until the reader re-picks. The curated
rotation was re-audited against the upstream palettes: every theme
still passes, with ir-black renamed to follow upstream.

Signed-off-by: Alex Suraci <[email protected]>
Rerunning the contrast audit over the full generated pool surfaces 22
schemes that arrived with the tinted-theming/schemes submodule and
pass every check, so the rotation gains them: six light themes
(alucard — Dracula's official light variant — charcoal-light,
kissa-latte, measured-light, precious-light-warm, precious-light-
white), which more than restores the depth the readability cuts took
from the light list, and sixteen dark ones (the chinoiserie, da-one,
everforest, kissa, measured, penumbra, and precious families plus
eldritch and spaceduck). Schemes that only pass with muted comment
text were left out, as were long-available schemes that were never
curated before.

Signed-off-by: Alex Suraci <[email protected]>
@vito vito changed the title docs: drop unreadable themes from the rotation docs: theme readability audit + generate base16 CSS from tinted-theming/schemes Jun 11, 2026
Include every scheme from the generated pool that passes the contrast
audit cleanly, dropping the aesthetic cherry-picking from the previous
commit: ashes, bright, danqing, gigavolt, google-dark, harmonic16-
dark, helios, ia-dark, and windows-10 join the dark rotation. To keep
multi-variant families from dominating the random roll, each family
contributes one variant, chosen by the most contrast headroom on its
worst role pair: chinoiserie-night, da-one-black (three-way tie,
alphabetical), precious-dark-eleven, precious-light-white, and the
flagship everforest. Same-family schemes split across the light and
dark lists (kissa, measured, ia) are kept on both sides since the two
rotations never compete in one roll. The dark rotation lands at 50
schemes and the light at 15, re-audited from the lists in switcher.js
with zero failures.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito merged commit 2425aa2 into main Jun 11, 2026
8 checks passed
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