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

[TextField] red error text fails a11y contrast ratio requirement of 4.5:1 #26288

Closed
2 tasks done
slayybelle opened this issue May 14, 2021 · 1 comment · Fixed by #26555
Closed
2 tasks done

[TextField] red error text fails a11y contrast ratio requirement of 4.5:1 #26288

slayybelle opened this issue May 14, 2021 · 1 comment · Fixed by #26555
Labels
accessibility a11y breaking change bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process

Comments

@slayybelle
Copy link

Even on a white background, the error text for [TextField] is flagged at < 4.5:1 ratio, unacceptable for accessibility

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The default red error text is too light against the best-case white background

Expected Behavior 🤔

It should be at least 4.5:1 on a white background; Default behavior on hover often darkens the background, requiring an even darker red to pass

Steps to Reproduce 🕹

Steps:

  1. https://next.material-ui.com/components/text-fields/
  2. Go to Validation section where there's demo of red error text
  3. I'll attach a pic where I open dev tools and use Lighthouse element inspector to inspect the text and it flags the contrast violation

Screen Shot 2021-05-13 at 6 08 12 PM

Context 🔦

a11y testing; conformance required by customers

Your Environment 🌎

Your demo page (see url above, step 1); also happens on latest 4.x

@slayybelle slayybelle added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 14, 2021
@slayybelle
Copy link
Author

Here's a work-around I will do: Add to createMuiTheme:

MuiFormLabel: {
            root: {
                "&$error": {
                    color: COLOR_DM_BG_LIGHTEST_RED,
                }
            }
        },
        MuiFormHelperText: {
            root: {
                "&$error": {
                    color: COLOR_DM_BG_LIGHTEST_RED,
                }
            }
        },

where:
export const COLOR_DM_BG_LIGHTEST_RED = "#DE3421";

@mnajdova mnajdova added accessibility a11y component: text field This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 14, 2021
@oliviertassinari oliviertassinari added design: material This is about Material Design, please involve a visual or UX designer in the process breaking change labels May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y breaking change bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants