Skip to content
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(#165): placeholder text color contrast #166

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

majornista
Copy link
Collaborator

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

  1. Go to https://opensource.adobe.com/coral-spectrum/examples/#textfield, https://opensource.adobe.com/coral-spectrum/examples/#textarea, https://opensource.adobe.com/coral-spectrum/examples/#select, https://opensource.adobe.com/coral-spectrum/examples/#clock.
  2. Inspect the placeholder text element in the sub-dom for any of the enabled textfield examples that use placeholder.
  3. Observe that the color specified in CSS for the placeholder element has a contrast ratio of 3:1, for the .coral-lightest theme it's rgb(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:

Current behavior using Gray-600

Desired behavior:

Current behavior using Gray-700

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

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.
@gagan031992
Copy link
Contributor

@icaraps @CezCz : Please review

Copy link
Collaborator

@Pareesh Pareesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@majornista majornista merged commit 710d835 into adobe:master Apr 19, 2021
github-actions bot pushed a commit that referenced this pull request Apr 19, 2021
## [4.10.18](v4.10.17...v4.10.18) (2021-04-19)

### Bug Fixes

* **#165:** placeholder text color contrast ([#166](#166)) ([710d835](710d835)), closes [#165](#165)
@github-actions
Copy link

🎉 This PR is included in version 4.10.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants