Skip to content

Commit

Permalink
[docs] add docs for a11y-no-redundant-roles (sveltejs#7195)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrich authored and nevilm-lt committed Apr 21, 2022
1 parent a5a5431 commit 58b81f0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions site/content/docs/05-accessibility-warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,20 @@ Enforce that `on:mouseover` and `on:mouseout` are accompanied by `on:focus` and

---

### `a11y-no-redundant-roles`

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.

```sv
<!-- A11y: Redundant role 'button' -->
<button role="button" />
<!-- A11y: Redundant role 'img' -->
<img role="img" src="foo.jpg" />
```

---

### `a11y-positive-tabindex`

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

0 comments on commit 58b81f0

Please sign in to comment.