Skip to content

fix: align light theme with modern GitHub for visible diff highlights#387

Merged
tomasz-tomczyk merged 1 commit intomainfrom
issue-384-light-contrast
Apr 29, 2026
Merged

fix: align light theme with modern GitHub for visible diff highlights#387
tomasz-tomczyk merged 1 commit intomainfrom
issue-384-light-contrast

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Closes #384.

Summary

  • Switches light-theme diff highlights from low-alpha rgba overlays to opaque Primer v8 values (#dafbe1, #aceebb, #ffebe9, #ffcecb). The faint highlights reported in Lacking contrast in light mode #384 were technically WCAG AA compliant but visually washed-out — the rgba overlays rendered as near-white on the page bg.
  • Aligns the rest of the editor's light tokens (surfaces, fg, hljs syntax) with current Primer v8 — what github.com ships today. The inline hljs theme had drifted from both upstream github.css (2021) and from current Primer.
  • Three small AA-driven divergences from GH so we still pass the existing axe AA test where GH itself fails: hljs-built_in darkened to #953800; deletion-row gutter line numbers and .hljs-* > .diff-word-del groups darkened to #1f2328.
  • Dark theme (Tokyo Night) untouched.

See also: tomasz-tomczyk/crit-web#138 (parity mirror).

Review

  • Code review: passed
  • Parity audit: matches crit-web/assets/css/app.css

Test plan

  • gofmt -l . — clean
  • golangci-lint run ./... — 0 issues
  • go test -race ./... — pass
  • e2e/tests/accessibility.spec.ts --project=git-mode — light-theme color-contrast and critical-violations tests PASS (dark-theme test fails pre-existing, unrelated to this change)

🤖 Generated with Claude Code

Closes #384.

The light theme used low-alpha rgba overlays for diff highlights, which
visually rendered as near-white and made additions/deletions hard to see.
Switch to opaque Primer v8 values (#dafbe1, #aceebb, #ffebe9, #ffcecb)
so highlights are perceptible against the page background.

Also align the rest of the editor's light tokens to current Primer v8:
- Editor surfaces (#fafafa -> #ffffff, card/elevated/gutter to GH greys)
- Editor fg (#24292f -> #1f2328, muted to #59636e)
- hljs syntax tokens (keyword #cf222e, comment #59636e, etc.) — the
  inline hljs theme had drifted from upstream github.css and from
  current Primer; this is what github.com ships today.

Three small accessibility-driven divergences from GH so we still pass
the axe WCAG AA test that GH itself fails on these spots:
- hljs built_in #953800 instead of #e36209
- Deletion-row gutter line numbers darkened to #1f2328
- hljs keyword/name/comment groups darkened to #1f2328 when nested
  inside .diff-word-del

Dark theme (Tokyo Night) untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.59%. Comparing base (6cbb4dd) to head (36a7f8e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #387      +/-   ##
==========================================
+ Coverage   66.56%   66.59%   +0.03%     
==========================================
  Files          19       19              
  Lines        8176     8176              
==========================================
+ Hits         5442     5445       +3     
+ Misses       2311     2309       -2     
+ Partials      423      422       -1     
Flag Coverage Δ
e2e 34.07% <ø> (+0.25%) ⬆️
unit 62.61% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk tomasz-tomczyk merged commit 41ad343 into main Apr 29, 2026
6 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the issue-384-light-contrast branch April 29, 2026 09:34
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.

Lacking contrast in light mode

1 participant