fix(a11y): JSON syntax highlighting fails contrast ratio in dark mode#2
Open
uidaho-nsummers wants to merge 1 commit into
Open
fix(a11y): JSON syntax highlighting fails contrast ratio in dark mode#2uidaho-nsummers wants to merge 1 commit into
uidaho-nsummers wants to merge 1 commit into
Conversation
Adds missing Pygments token overrides for dark mode: .nt (JSON property keys) and .kc (JSON true/false/null literals) were falling through to the GitHub light theme colors (~1.8:1 contrast) against the #1e1e2e background. Both now use Catppuccin Mocha colors matching the existing dark theme (#89b4fa and #cba6f7), achieving 8:1 and 7.7:1 contrast ratios (WCAG AAA). Fixes ui-insight#1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes #1
Summary
.nt(Name.Tag — JSON property keys) to the blue names token group in the dark mode Pygments override.kc(Keyword.Constant — JSONtrue/false/null) to the purple keywords token group in the dark mode Pygments overrideThe Pygments GitHub light theme was loaded from CDN and not overridden for these two token classes, causing ~1.8:1 contrast ratios in dark mode against the
#1e1e2ebackground. Both token classes now resolve to Catppuccin Mocha palette colors that pass WCAG AA (4.5:1 minimum).Changes
backend/app/dashboard/templates/blog/post.html— two selectors added to existing dark mode CSS blockPre-existing quality issues (out of scope)
The
mainbranch has the following quality issues that predate this change and are not introduced or worsened by this fix:uv run --extra dev ruff check backend/)main:test_version_alignment, and 2×test_voice_apitest_quota.pyandtest_scheduler.pyfail to collect due to a missing DB URL in the test environmentThese are noted here for transparency. Addressing them is recommended but outside the scope of this accessibility fix.