fix(#165): placeholder text color contrast #166
Merged
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
Expected Behavior
Placeholder text for Search, Select, Textarea and Textfield components should comply with WCAG 2.1 AA contrast ratio requirements with a contrast ratio between the foreground text color and the background color or at least 4.5:1.
Actual Behavior
Currently, Coral-Spectrum uses
var(--spectrum-global-color-gray-600);
from Spectrum-CSS, for the::placeholder
text color in Search, Select, Textarea and Textfield components, which results in placeholder text with a contrast ratio of 3:1, which does not comply with WCAG 2.1 AA contrast ratio requirements.Spectrum-CSS includes a fix for this in v3.0.1, (see adobe/spectrum-css@011ca54), updating Coral-Spectrum to use this version of Spectrum-CSS is not trivial.
A simpler suggested fix would be to change the value in Coral-Spectrum to use
var(--spectrum-global-color-gray-700);
to satisfy the requirement.Reproduce Scenario (including but not limited to)
Steps to Reproduce
.coral-lightest
theme it'srgb(149, 149, 149)
.Browser name/version/os
Version 89.0.4389.114 (Official Build) (x86_64) on macOS
Coral Spectrum version
v4.10.16
Sample Code that illustrates the problem (use the Playground if possible)
Coral Spectrum Playground Example
Related Issue
#165
Motivation and Context
This fix addresses numerous color contrast accessibility issues identified in AEM.
How Has This Been Tested?
Tested using color contrast evaluation tools against example pages:
Screenshots (if appropriate):
Current behavior:
Desired behavior:
Types of changes
Checklist: