Skip to content

Make code blocks readable - #2

Merged
LifeWorks merged 1 commit into
mainfrom
fix-code-block-contrast
Dec 3, 2026
Merged

LifeWorks merged 1 commit into
mainfrom
fix-code-block-contrast

Conversation

@LifeWorks

Copy link
Copy Markdown
Member

The ipSAE listing in the ORF3a report renders as near-white text on a white background.

Cause

Two stylesheets disagree, and neither is wrong on its own:

  • typography.min.css styles .prose pre for a dark panel: background-color:#1f2937; color:#e5e7eb.
  • main.css, which loads after it, overrides the background to white — and leaves the text colour alone.

The result is #e5e7eb on #ffffff: a contrast ratio of about 1.2:1, against the 4.5:1 that WCAG AA asks for.

Fix

site.css loads last, so the pair is set there together — a soft panel in the site's greens, ink-coloured text, and a green left rule that matches the report's tables and figure. overflow-x also moves from hidden to auto, so a long line scrolls rather than being silently clipped.

The rule is site-wide rather than scoped to .bj-report, because the bug lives in the shared stylesheet and would hit any code block added later. Today the report is the only page with a non-mermaid <pre>, so nothing else changes.

Checked

Rendered against the local build (zola build --base-url http://127.0.0.1:8731, since the published pages reference absolute CSS URLs). Code is dark on the panel; the rest of the page is untouched.

🤖 Generated with Claude Code

main.css sets .prose pre to a white background, but the text colour is
left at Tailwind Typography's #e5e7eb, which that stylesheet chose to sit
on its own dark panel. Near-white on white: the ipSAE listing in the
ORF3a report was all but invisible.

Set both sides of the pair in site.css, which loads last: a soft panel in
the site's greens with ink-coloured text and a green left rule, matching
the report's tables and figures. Also switches overflow-x from hidden to
auto, so a long line scrolls instead of being clipped.

Site-wide rather than scoped to .bj-report, since the bug is in the
shared stylesheet and would bite any future code block.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@LifeWorks
LifeWorks merged commit 94f9f42 into main Dec 3, 2026
2 checks passed
@LifeWorks
LifeWorks deleted the fix-code-block-contrast branch December 3, 2026 20:51
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