Repository navigation
docs: theme readability audit + generate base16 CSS from tinted-theming/schemes - #111
Merged
Merged
Conversation
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]>
Deploying dang with
|
| Latest commit: |
b8bf705
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://142b2a96.dang-3kk.pages.dev |
| Branch Preview URL: | https://theme-whitelist-readability.dang-3kk.pages.dev |
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]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, inlinep codechips), 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.
#e8e8e8on 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)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 thedocs/schemessubmodule andcmd/genthemesgenerates 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 inchroma.cssuntil they re-pick.build.shinitializes 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.
The
measuredandpenumbrafamilies 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