Skip to content

Syntax highlighting: Make WCAG 2.1 compliant

Warren Gifford requested to merge tr/color-contrast-diff into main

Created by: umpox

Description

This PR introduces feature-flagged changes to our syntax highlighting that make it WCAG 2.1 compliant. This is still experimental, as we want to ensure that we do not regress on general readability whilst making these changes.

This should result in significantly less (or 0) color contrast violations in our syntax highlighting in both light and dark mode.

Introduction plan

Week 1/2: Enable site wide for the Sourcegraph organization on Sourcegraph.com. Post in #dev-chat, ask for feedback and address. Week 3: If no outstanding feedback, enable for everyone (remove the feature flag)

Comparisons

PAGE BEFORE AFTER
Blob view 269 violations image 0 violations image
Search results 125 violations image 0 violations image
Diff view 1708 violations (entire diff) image 0 violations (entire diff) image

Test plan

Tested locally. Changes are feature flagged so easy to revert if needed.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading