Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(input): floating label text fails a11y contrast audit #11497

Merged
merged 1 commit into from
Aug 14, 2019

Conversation

Splaktar
Copy link
Contributor

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Floating labels use color: rgba(0,0,0,0.38); which doesn't align with the spec and fails Lighthouse contrast audits. This is the color we use for "disabled" text, which isn't right.
screen shot 2018-10-30 at 3 51 07 pm
screen shot 2018-10-30 at 3 53 15 pm
Currently our Input demo page gets a Lighthouse score of 77.

Issue Number:
Relates to #11475

What is the new behavior?

Floating labels use rgba(0, 0, 0, 0.54); which passes Lighthouse contrast audits. This is the color we use for "secondary" text, which seems appropriate. We use the full rgba(0, 0, 0, 0.87); for the primary text (input value).
screen shot 2018-10-30 at 3 51 33 pm
screen shot 2018-10-30 at 3 53 39 pm
With these changes our Input demo page gets a Lighthouse score of 92.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This is expected to break screenshot tests.

This gets us a step closer to getting 100 in the Lighthouse a11y audit.
Other related issues are

@Splaktar Splaktar added the a11y This issue is related to accessibility label Oct 30, 2018
@Splaktar Splaktar requested a review from jelbourn October 30, 2018 20:13
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Oct 30, 2018
@Splaktar Splaktar force-pushed the inputFloatingLabelContrast branch from f15abee to e05a465 Compare October 30, 2018 20:14
@Splaktar Splaktar added type: bug P3: important Important issues that really should be fixed when possible. labels Oct 30, 2018
@Splaktar Splaktar added this to the 1.1.12 milestone Oct 30, 2018
@Splaktar Splaktar self-assigned this Oct 30, 2018
@Splaktar Splaktar added the pr: merge ready This PR is ready for a caretaker to review label Oct 30, 2018
@Splaktar Splaktar assigned jelbourn and mmalerba and unassigned jelbourn Dec 20, 2018
@Splaktar Splaktar modified the milestones: 1.1.12, 1.1.13 Jan 3, 2019
@Splaktar Splaktar assigned mmalerba and unassigned andrewseguin Jan 29, 2019
@Splaktar Splaktar added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Mar 16, 2019
@Splaktar Splaktar modified the milestones: 1.1.15, 1.1.16, 1.1.18, 1.1.19 Mar 29, 2019
@Splaktar Splaktar modified the milestones: 1.1.19, 1.1.20 May 31, 2019
@Splaktar Splaktar force-pushed the inputFloatingLabelContrast branch 2 times, most recently from f9a422a to c96d214 Compare June 6, 2019 05:22
@Splaktar Splaktar added pr: merge ready This PR is ready for a caretaker to review and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Jun 6, 2019
@Splaktar
Copy link
Contributor Author

Splaktar commented Jun 6, 2019

Firefox issue solved. Thanks for the heads up @bersLucas!

@Splaktar Splaktar assigned mmalerba and unassigned josephperrott Jun 13, 2019
@Splaktar Splaktar assigned jelbourn and unassigned mmalerba Jun 20, 2019
add special handling for Firefox placeholders
add `::placeholder` to the list of pseudos
remove duplicate `::-webkit-input-placeholder`
add `::-ms-input-placeholder` for Edge
fix demo a11y issues

Relates to #11475
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P3: important Important issues that really should be fixed when possible. pr: merge ready This PR is ready for a caretaker to review type: bug type: spec alignment For issues related to aligning with the Material Design Spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants