-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(a11y): update code highlight colors to meet contrast requirement #1724
fix(a11y): update code highlight colors to meet contrast requirement #1724
Conversation
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done! I think this is subtle enough that even meta won't notice (the best kind of change) 🥇
For what it's worth, I vaguely remember discussing using Stacks colors for code way back when and the reason we didn't go that route was because it was:
A. really hard because we have less colors to work with
B. felt/looked odd to most developers because the colors were different than the tones they are used to seeing in code
I support the decision to NOT go down that rabbit hole — I think that would need CM support and lots of feedback rounds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fantastic subtle change that will make us compliant with our own contrast targets. Awesome work @dancormier ...and I love we have tests helping us to catch future regressions.
Addresses:
This PR resolves outstanding contrast issues with code highlight colors. The changes should be subtle enough as to barely be noticeable.
Note
We could attempt to change many of these colors to use core Stacks colors, but I figure it's best to keep it simple for now in order to resolve A11Y issues and decide later if we want to make more sweeping changes here.
Color variable changes
--highlight-literal
hsl(27, 85%, 61.5%)
hsl(27, 95%, 65%)
--highlight-namespace
hsl(27, 85%, 61.5%)
hsl(27, 95%, 65%)
--highlight-symbol
hsl(306, 43%, 69%)
hsl(306, 50%, 75%)
--highlight-variable
hsl(88, 100%, 19%)
hsl(88, 100%, 18%)
Screenshot comparison (dark mode)
Note: The difference is in the orange (e.g.:
0.6em 0.7em
) and purple (e.g.:border-radius
) text.Before
After
Screenshot comparison (light HC mode)
Note: The difference is in the green (e.g.:
apples
) text.Before
After
To test