Your daily frequent11y newsletter, brought to you by @ChrisBAshton:
Almost 50% Got This #a11y Question Wrong! — WCAG Explained (8m video)
- Eric Eggert asked Twitter if the following code fails WCAG:
<button aria-level="2">Action</button>
- 49% thought it failed WCAG, but Eric explains why it doesn’t. This all may seem a bit hypothetical, but it’s actually quite a useful exercise in how to judge code against the WCAG criteria.
- Eric admits the code is invalid ARIA, as buttons can’t have levels (
level
doesn’t appear on the button role documentation, nor doesbutton
appear on the aria-level docs), but that does not constitute a WCAG failure. - It doesn’t fail SC 4.1.1 Parsing, as the HTML can still be parsed. SC 4.1.2 Name, Role, Value also passes; it says that “states, properties, values that can be set by the user can be programmatically set”, but as aria-level is unsupported on the button element, it cannot be set by the user.
- Eric explains a couple more WCAG criteria that people cited, and why they don’t apply. Worth a watch.
Prefer longer newsletters? You can subscribe to week11y, fortnight11y or even month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.