Skip to content

Commit d0ea20f

Browse files
committed
* add recent primer common patterns links and better heading structures
1 parent 2e4e839 commit d0ea20f

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

docs/rules/accessibility/avoid-both-disabled-and-aria-disabled.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ HTML elements with `disabled` are ignored when a screen reader uses tab navigati
99

1010
This linter will raise when both `aria-disabled` and `disabled` are set on HTML elements that natively support `disabled` including `button`, `fieldset`, `input`, `optgroup`, `option`, `select`, and `textarea`.
1111

12+
## Examples
1213
### 👎 Examples of **incorrect** code for this rule:
1314

1415
```erb

docs/rules/accessibility/iframe-has-title.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
`<iframe>` should have a unique title attribute that identifies the content. The title will help screen reader users determine whether to explore the frame in detail. If an `<iframe>` contains no meaningful content, hide it by setting `aria-hidden="true"`.
66

7+
## Examples
78
### 👎 Examples of **incorrect** code for this rule:
89

910
```erb

docs/rules/accessibility/image-has-alt.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
`<img>` should have an alt prop with meaningful text or an empty string for decorative images.
66

7-
Learn more at [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/).
7+
## Resources
88

9+
- [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/)
10+
- [Primer: Alternative text for images](https://primer.style/design/accessibility/alternative-text-for-images)
11+
12+
## Examples
913
### 👎 Examples of **incorrect** code for this rule:
1014

1115
```erb

docs/rules/accessibility/no-aria-label-misuse-counter.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ This rule aims to discourage common misuse of the `aria-label` and `aria-labelle
66

77
### "Help! I'm trying to set a tooltip on a static element and this rule flagged it!"
88

9-
Please do not use tooltips on static elements. It is a highly discouraged, inaccessible pattern for the following reasons:
10-
11-
- Static elements are not tab-focusable so keyboard-only users will not be able to access the tooltip at all. (Note: setting `tabindex="0"` to force a generic element to be focusable is not a solution.)
12-
- It's likely that tooltip is inappropriate for your usecase to begin with. Tooltips are not accessible at all on mobile devices so if you're trying to convey critical information, use something else. Additionally, implementing tooltip as `aria-label` is rarely appropriate and has potential to cause accessibility issues for screen reader users.
13-
14-
If you've determined the tooltip content is not critical, simply remove it. If you determine the tooltip content is important to keep, we encourage you to reach out to a design or accessibility team who can assist in finding an alternate, non-tooltip pattern.
9+
Please do not use tooltips on static elements. It is a highly discouraged, inaccessible pattern.
10+
See [Primer: Tooltip alternatives](https://primer.style/design/accessibility/tooltip-alternatives) for what to do instead.
1511

1612
### Resources
1713

1814
- [w3c/aria Consider prohibiting author naming certain roles #833](https://github.com/w3c/aria/issues/833)
1915
- [Not so short note on aria-label usage - Big Table Edition](https://html5accessibility.com/stuff/2020/11/07/not-so-short-note-on-aria-label-usage-big-table-edition/)
2016
- [Your tooltips are bogus](https://heydonworks.com/article/your-tooltips-are-bogus/)
17+
- [Primer: Tooltip alternatives](https://primer.style/design/accessibility/tooltip-alternatives)
2118

2219
### Disclaimer
2320

docs/rules/accessibility/no-positive-tab-index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Learn more at:
99
- [A11yProject: Use the tabindex attribute](https://www.a11yproject.com/posts/how-to-use-the-tabindex-attribute/)
1010
- [Deque: Avoid using Tabindex with positive numbers](https://dequeuniversity.com/tips/tabindex-positive-numbers)
1111

12+
## Examples
1213
### 👎 Examples of **incorrect** code for this rule:
1314

1415
```erb

docs/rules/accessibility/no-redundant-image-alt.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
This rule does not discourage conveying the _medium_ of the image which may be considered important to help a user better understand the content.
88
For example, this rule will not flag terms including `screenshot`, `painting`, or `photograph`.
99

10-
Learn more at [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/).
10+
## Resources
1111

12+
- [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/)
13+
- [Primer: Alternative text for images](https://primer.style/design/accessibility/alternative-text-for-images)
14+
15+
## Examples
1216
### 👎 Examples of **incorrect** code for this rule:
1317

1418
```erb

docs/rules/accessibility/no-title-attribute-counter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ If you are considering the`title` attribute to provide supplementary description
1212

1313
Use a `<title>` element instead of the `title` attribute, or an `aria-label`.
1414

15-
### Resources
15+
## Resources
1616

1717
- [TPGI: Using the HTML title attribute ](https://www.tpgi.com/using-the-html-title-attribute/)
1818
- [The Trials and Tribulations of the Title Attribute](https://www.24a11y.com/2017/the-trials-and-tribulations-of-the-title-attribute/)
1919

20+
## Examples
2021
### 👎 Examples of **incorrect** code for this rule:
2122

2223
```erb

0 commit comments

Comments
 (0)