fix: improve constant.regexp contrast in Dark VS theme#306554
Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: improve constant.regexp contrast in Dark VS theme#306554yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Change constant.regexp foreground from #646695 (3.08:1 contrast) to #d16969 (4.71:1 contrast) against the #1E1E1E editor background. The previous color failed WCAG AA minimum contrast (4.5:1) for normal text, making regex constants hard to read. The new color matches string.regexp, which represents the same concept (regex literals) and already meets accessibility standards. Closes microsoft#202381
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.
What kind of change does this PR introduce?
Bug fix (accessibility / theme contrast)
What is the current behavior?
The
constant.regexptoken scope in the Dark VS theme (which Dark+ and Dark Modern inherit) uses#646695as its foreground color. Against the#1E1E1Eeditor background, this yields a contrast ratio of only 3.08:1 — below the WCAG AA minimum of 4.5:1 for normal text. This makes regex constants hard to read.Meanwhile, the semantically equivalent
string.regexpscope uses#D16969with a contrast ratio of 4.71:1, which meets the standard.Closes #202381
What is the new behavior?
Changes the
constant.regexpforeground from#646695to#d16969, matching thestring.regexpcolor. Both scopes represent regular expression literals, so using the same color is semantically consistent and meets WCAG AA contrast requirements.constant.regexp#646695(3.08:1)#d16969(4.71:1)string.regexp#d16969(4.71:1)Additional context
#1F1F1Fbg) also benefits: contrast improves from 3.04:1 to 4.66:1dark_vs.json#d16969forstring.regexpand#b46695forconstant.regexp(which has adequate contrast on its#000000background)