Skip to content

Improve dark-mode syntax highlighting for sphinxawesome theme#121

Merged
timkpaine merged 1 commit into
mainfrom
dark-mode-syntax-highlighting
Jul 18, 2026
Merged

Improve dark-mode syntax highlighting for sphinxawesome theme#121
timkpaine merged 1 commit into
mainfrom
dark-mode-syntax-highlighting

Conversation

@timkpaine

@timkpaine timkpaine commented Jul 18, 2026

Copy link
Copy Markdown
Member

The sphinxawesome theme's dark mode was hard to read: yardang builds Pygments with the light sphinx style (and there is no dark variant), so on the forced #1e2433 dark code background the dark-blue tokens (strings #4070a0, functions #06287e, classes #0e84b5) were low-contrast.

This adds a GitHub Dark token palette scoped under .dark .highlight in the bundled sphinxawesome_theme.css. Because .dark .highlight .s1 (specificity 0,2,1) beats the light .highlight .s1 (0,1,1), it overrides token colors in dark mode only; the code background stays #1e2433.

The light "sphinx" Pygments style is unreadable on the dark code
background (dark-blue strings, functions, and classes). Add a GitHub
Dark token palette scoped under .dark so dark mode uses readable colors
while light mode is unchanged.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

67 tests  ±0   67 ✅ ±0   22s ⏱️ -1s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit d7f4e73. ± Comparison against base commit d978263.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.72%. Comparing base (d978263) to head (d7f4e73).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121   +/-   ##
=======================================
  Coverage   83.72%   83.72%           
=======================================
  Files          10       10           
  Lines        1456     1456           
  Branches      150      150           
=======================================
  Hits         1219     1219           
  Misses        198      198           
  Partials       39       39           

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

@timkpaine
timkpaine merged commit 2e48e56 into main Jul 18, 2026
4 checks passed
@timkpaine
timkpaine deleted the dark-mode-syntax-highlighting branch July 18, 2026 19:13
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