Skip to content

docs: Add a visual with color palettes#113

Merged
ebouchut merged 2 commits into
devfrom
docs/theme-palette-visuals
Jul 16, 2026
Merged

docs: Add a visual with color palettes#113
ebouchut merged 2 commits into
devfrom
docs/theme-palette-visuals

Conversation

@ebouchut

@ebouchut ebouchut commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Add a side-by-side visual comparison of color palettes (themes), along with a rating of the contrast ratio (RGAA).

ebouchut added 2 commits July 15, 2026 22:08
A new Color palettes section in theme-exploration.md shows every
design token of the four palettes (Catppuccin Latte and Mocha, Soft
Paper light and dark) as a colored swatch grid rendered natively by
GitHub from Mermaid flowcharts, so no image file is committed.

The diagrams are generated from the theme stylesheets (the source of
truth) by the new scripts/generate_palette_diagrams.py, which picks
each swatch label's color by WCAG relative luminance so the token name
stays readable on its own background. Mermaid's block-beta grid would
be the natural shape but it ignores the label color, leaving dark
swatches unreadable, so the script emits flowcharts whose disconnected
rows of invisible links stack into a grid; verified with mermaid-cli.

Regenerate after any token change:
python3 scripts/generate_palette_diagrams.py
docs/design/palettes.html shows the four palettes as side by side
cards, each rendered with its own background, text, and border colors,
and every token with its computed WCAG contrast ratio against its
reference background (text tokens against bg, on-primary against
primary, code tokens against code-bg, focus against bg at the 3:1 UI
threshold) plus the AA verdict. Surface tokens are marked as decor.
Self contained, French, print friendly: made to be attached to the
dossier as is.

The page is emitted by the same generator as the Mermaid section
(scripts/generate_palette_diagrams.py, new --html flag), so both views
regenerate from the theme stylesheets and cannot drift. The computed
ratios were checked against the ones documented in the stylesheet
comments (exact match). The Color palettes section of the theme study
now links to the page.

Side finding surfaced by the page: Soft Paper's code-comment token
fails AA against code-bg in both modes (3.65:1 and 4.45:1); harmless
today (code tokens only paint the decorative aria-hidden hero card)
but to fix before lesson code blocks ship with that theme.
@ebouchut ebouchut self-assigned this Jul 16, 2026
@ebouchut ebouchut added documentation Improvements or additions to documentation frontend labels Jul 16, 2026
@ebouchut ebouchut moved this to In Review in learn-dev-project Jul 16, 2026
@ebouchut ebouchut added this to the v0.7 - Doc Freeze milestone Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.33%. Comparing base (66911ac) to head (ba42a4d).

Additional details and impacted files
@@            Coverage Diff            @@
##                dev     #113   +/-   ##
=========================================
  Coverage     80.33%   80.33%           
  Complexity      186      186           
=========================================
  Files            38       38           
  Lines           783      783           
  Branches         42       42           
=========================================
  Hits            629      629           
  Misses          124      124           
  Partials         30       30           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ebouchut
ebouchut merged commit 35eab7b into dev Jul 16, 2026
7 checks passed
@ebouchut
ebouchut deleted the docs/theme-palette-visuals branch July 16, 2026 08:34
@github-project-automation github-project-automation Bot moved this from In Review to Done in learn-dev-project Jul 16, 2026
@ebouchut ebouchut added accessibility Accessibility (RGAA, WCAG) dwwm labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Accessibility (RGAA, WCAG) documentation Improvements or additions to documentation dwwm frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant