Skip to content

Commit d1b3f46

Browse files
authored
[docs] add docs for a11y-no-redundant-roles (#7195)
1 parent e460acc commit d1b3f46

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

site/content/docs/05-accessibility-warnings.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,20 @@ Enforce that `on:mouseover` and `on:mouseout` are accompanied by `on:focus` and
213213

214214
---
215215

216+
### `a11y-no-redundant-roles`
217+
218+
Some HTML elements have default ARIA roles. Giving these elements an ARIA role that is already set by the browser [has no effect](https://www.w3.org/TR/using-aria/#aria-does-nothing) and is redundant.
219+
220+
```sv
221+
<!-- A11y: Redundant role 'button' -->
222+
<button role="button" />
223+
224+
<!-- A11y: Redundant role 'img' -->
225+
<img role="img" src="foo.jpg" />
226+
```
227+
228+
---
229+
216230
### `a11y-positive-tabindex`
217231

218232
Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users.

0 commit comments

Comments
 (0)