Improve dark-mode syntax highlighting for sphinxawesome theme#121
Merged
Conversation
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>
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
The sphinxawesome theme's dark mode was hard to read: yardang builds Pygments with the light
sphinxstyle (and there is no dark variant), so on the forced#1e2433dark 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 .highlightin the bundledsphinxawesome_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.