Fix color contrast accessibility issue in code syntax highlighting #5007
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.
Problem
The PWA Builder documentation site had insufficient color contrast in code syntax highlighting, specifically for builtin tokens like
console
. The problematic green color#669900
on white background provided only a 3.43:1 contrast ratio, failing to meet WCAG AA accessibility requirements of 4.5:1.This affected users with visual impairments and made code examples difficult to read in various lighting conditions.
Solution
Replaced the problematic color with
#4d7300
, which provides a 5.57:1 contrast ratio, exceeding WCAG AA standards while maintaining the semantic meaning of green for builtin tokens.Changes Made
docs/styles/vs-prism.css
targeting.token.builtin
and related selectors!important
declarations to override external CDN stylesheets (docsify-themeable, Prism.js)Verification
Impact
This fix improves accessibility for:
Fixes #4962.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.