Fix disabled-text scss styling to meet a11y standards
See original GitHub issuedisabled-text
usage should be replaced to meet accessibility contrast requirements
Replace disabled text usage to new shared constant:
- badge
- datepicker
- form field
- input
- select
- stepper
- tabs
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
CSS Techniques for WCAG 2.0 - W3C
This Web page lists CSS Techniques from Techniques for WCAG 2.0: Techniques ... When the style sheets are not applied, the text appears...
Read more >disabled - CSS: Cascading Style Sheets - MDN Web Docs
The :disabled CSS pseudo-class represents any disabled element. An element is disabled if it can't be activated (selected, clicked on, typed ...
Read more >Making Disabled Buttons More Inclusive - CSS-Tricks
Preventing people from doing an invalid or unavailable action is the most common reason we might reach for a disabled button.
Read more >Buttons - A11Y Style Guide
In order to meet the guidelines at the stricter Level AAA, the contrast ratio must be at least 7:1 (or 4.5:1 for large...
Read more >Accessibility and usability considerations for disabling buttons ...
Broadly speaking, it's best not to disable buttons or inputs. Instead we can allow data entry and provide helpful error text (either inline ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also, WCAG states the following:
So TL;DR disabled controls don’t actually have a text contrast requirement. Personally I think this is not the best, but that’s the standard today. If we can confirm that all of these cases are genuinely for inactive controls, that lowers the priority in my estimation (to P4).
@Splaktar I don’t think this can be fully fixed in MDC, though, since we don’t have (or plan to have) MDC versions of badge, datepicker, or stepper.
I discovered the issue while performing aXe tests across the codebase. The
disabled-text
check failed in its usages here.If I remember correctly, we determined that for many of these we would need to consult with the Material team to determine if it was a spec issue or something in our implementation.