aria-hidden-body
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: offhtml/html-validate-recommended
What it does
Section titled “What it does”Reports aria-hidden="true" on <body>.
Why it matters
Section titled “Why it matters”The attribute removes an element and all of its content from the accessibility tree, so on <body> the whole page is hidden from screen readers while it still shows on screen.
To fix, remove the attribute. To hide only a part of the page, put it on that part.
Example
Section titled “Example”...<head>...</head><body aria-hidden="true">...<h2><img src="a.png" alt="x"></h2><h3>text</h3>...Configuration
Section titled “Configuration”angular: lint: rules: aria-hidden-body: warn # off (default), warn, errorhtml: lint: rules: aria-hidden-body: warn # off (default), warn, errorsvelte: lint: rules: aria-hidden-body: warn # off (default), warn, errorvue: lint: rules: aria-hidden-body: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended.
Suppress one line with sudsy-disable-next-line aria-hidden-body in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| html-eslint | no-aria-hidden-body |
full |
| html-validate | aria-hidden-body |
full |