feat: improve form controls border contrast for accessibility #704
+50
−13
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.
Description
The default border colors for form controls in the default theme in Zendesk Garden don't meet the minimum 3:1 contrast ratio against the background. We apply a custom theme override to increase the contrast of these borders, following the guidelines provided by the Garden team in an internal doc.
The guidelines suggest adjusting the border colors by applying offsets, the approach has been extended to take into account all form controls.
By default, Garden sets the
grey.300color as the default border color in the light theme, and then it is increased by 100 for form controls, which is not sufficient, providing only 2:1 contrast ratio.To reach the 3:1 ratio, we need to use
grey.600and so we apply an offset of 300.We also enhance the hover state border color, which by default is less prominent when the border color is darker.
We also update the
$high-contrast-border-colorSass variable to match the new border color used in the theme override, and update the wysiwyg package that includes improved color contrast as wellScreenshots
Before:

After:

Checklist