Skip to content

Commit 8bb99a0

Browse files
committed
update image documentation based on recent discussion
1 parent 8226a4b commit 8bb99a0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
`<img>` alt prop should not contain `image` or `picture` as screen readers already announce the element as an image.
66

7+
This rule does not discourage conveying the _medium_ of the image which may be considered important to help a user better understand the content.
8+
For example, this rule will not flag terms including `screenshot`, `painting`, or `photograph`.
9+
710
Learn more at [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/).
811

912
### 👎 Examples of **incorrect** code for this rule:
@@ -12,15 +15,24 @@ Learn more at [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/
1215
<img alt="picture of Mona Lisa" src="monalisa.png">
1316
```
1417

18+
```erb
19+
<!-- also bad -->
20+
<img alt="image of a fluffy dog" src="monalisa.png">
21+
```
22+
1523
### 👍 Examples of **correct** code for this rule:
1624

1725
```erb
1826
<!-- good -->
1927
<img alt="Mona Lisa" src="monalisa.png">
2028
```
2129

22-
2330
```erb
2431
<!-- also good -->
2532
<img alt="The original painting of Mona Lisa hangs on the wall of Louvre museum" src="monalisa.png">
2633
```
34+
35+
```erb
36+
<!-- also good -->
37+
<img alt="Screenshot of the user profile Settings page, with the 'Notifications' item highlighted" src="settings_page.png">
38+
```

0 commit comments

Comments
 (0)