Validate a11y attributes
See original GitHub issueWhich @angular/* package(s) are relevant/releated to the feature request?
compiler-cli
Description
We should have the Angular compiler validate the types for a11y features of the DOM, such as role
or aria-*
attributes to make sure they are always set to valid values. This could allow the compiler to error or warn on bad a11y values and help users identify mistakes in their code which can lead to a more accessible experience.
Proposed solution
This could potentially be done as an extended diagnostic, or possibly through a *.d.ts
typecheck or other direct compiler integration. I’m not sure which would be more appropriate here.
Alternatives considered
N/A
Issue Analytics
- State:
- Created 2 years ago
- Reactions:46
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Checklist - The A11Y Project
The issues this checklist prompts you to check for covers a wide range of disability conditions. There is no such thing as “perfect...
Read more >Validating Input | Web Accessibility Initiative (WAI) - W3C
Validating required input. Forms frequently include required input that needs to be clearly identified using labels. Also, the required attribute can be ...
Read more >Page Accessibility Validation - Testim overview
Using the Validate page accessibility step, you can check the accessibility level of your web page, while identifying elements in your web page...
Read more >Accessibility Checker - Is Your Website Accessible?
10. [aria-*] attributes have valid values. Assistive technologies, like screen readers, are unable to interpret ARIA attributes if they have ...
Read more >Accessibility rule: ARIA attributes must conform to valid values
ARIA attributes (those beginning with aria- ) must have legitimate values. For a given attribute to fulfill the intended accessibility function, these values ......
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 FreeTop 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
Top GitHub Comments
Additional checks to consider
title
attribute in theRoute
definitions""
which would be invalid/not best practiceAnother source we can check for additional checks is what the axe tool’s static HTML checks are: https://github.com/dequelabs/axe-core
Love this idea! A great small start would be adding a check for
alt
on<img>
elements.