-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[material-ui][Button] Focus visible a11y issue #28543
Comments
cc @danilo-leal you may be interested in taking a look at this |
@mnajdova The ripple focus color is defined automatically with opacity on the theme, isn't it?! I guess that reducing the opacity a bit would tackle this the right way. |
We disabled focus ripple on buttons at createTheme level and also set MuiButton.root outline to undefined to let the browser handle the outline for a11y. I think reducing the opacity could pass the a11y. |
Note that the contrast ratio may have to hit 3:1 to pass WCAG 2.2 AA: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance-minimum.html I'm not sure if a smaller area that is that thick is sufficient. |
Hi team, is there any workaround at the moment that allows us to change the opacity used in the ripple effect? Thanks, in advance! |
@schopra8 you can override it by adding the touch ripple classes, here is a short demo: https://codesandbox.io/s/affectionate-jerry-7uqf81?file=/src/App.tsx You can check the TouchRipple.js source for more info/inspiration. |
@mnajdova @danilo-leal I guess reducing the opacity for ripple effect would meet contrast ratio. But then what about WCAG 2.4.11 focus appearance? I see these examples from WCAG guidelines clearly showing how it can be. I'm trying to understand where the current MUI buttons stand among these examples. https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance-minimum.html |
Current Behavior 😯
Button text color white with class Mui-focusVisible doesn't pass a11y.
https://color.a11y.com/ContrastPair/?bgcolor=5B93D3&fgcolor=ffffff
Steps to Reproduce 🕹
Steps:
The text was updated successfully, but these errors were encountered: