Skip to content

Commit dfa444d

Browse files
Add alt text guidelines for wagtail editors
1 parent 4dd8cae commit dfa444d

9 files changed

Lines changed: 74 additions & 0 deletions

File tree

docs/cms/alt-text.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Writing Alt Text (for Wagtail Editors)
2+
3+
The "alt text" (alternative text) on an image describes images for people who can't see them. Usually this means people who are having the webpage read aloud to them by a device or app.
4+
5+
## When to Use Alt Text
6+
7+
If the image is removed and no context is missing, then the image is decorative and doesn't need alt text. You can leave the field in Wagtail blank.
8+
9+
## Writing Effective Alt Text
10+
11+
- Be concise
12+
- Be specific
13+
- When there are people in it:
14+
- If you know their names, use their names
15+
- Do not mention gender, age, or race
16+
- Describe the action or mood conveyed
17+
18+
### Be Concise
19+
20+
Aim for under 125 characters when possible. Screen readers announce "image" or "graphic" before reading alt text, so don't start with "image of" or "picture of."
21+
22+
`Red panda sleeping on a tree branch`<br>
23+
`Photo of a red panda sleeping`<br>
24+
`A cute red panda sleeping peacefully on a tree branch in the forest`
25+
26+
### Be Specific
27+
28+
Describe what's actually in the image, focusing on details relevant to the surrounding content.
29+
30+
`Mozilla VPN dashboard showing connection status`<br>
31+
`VPN screenshot`
32+
33+
### When there are people in it
34+
35+
- If you know their names, use their names
36+
- Do not mention gender, age, or race
37+
- Describe the action or mood conveyed
38+
39+
`Person with a laptop bag and Mozilla lanyard.`<br>
40+
`Contributor at a Mozilla hack-a-thon.`<br>
41+
`Asian woman with her hair in a pony tail.`
42+
43+
## Examples
44+
45+
![A tab group of recipes.](../images/alt-text/recipes-group.png){ width="400" }
46+
47+
`A tab group of recipes.`<br>
48+
`Tab groups appear next to your open tabs.`<br>
49+
`Screenshot of Firefox`
50+
51+
![Mark Surman, Mozilla President.](../images/alt-text/surman.png){ width="400" }
52+
53+
`Mark Surman, Mozilla President.`<br>
54+
`Bald white man in a black jacket and red scarf.`
55+
56+
![People sitting in a circle on the floor sharing ideas.](../images/alt-text/floor.jpg){ width="400" }
57+
58+
`People sitting in a circle on the floor sharing ideas.`<br>
59+
`Nine people sitting on yellow pillows on the floor.`
60+
61+
![Nothing Personal logo.](../images/alt-text/np.jpg){ width="400" }
62+
63+
`Nothing Personal logo.`<br>
64+
✅ If the magazine's name is near-by, blank alt text might be the right thing to do with this image<br>
65+
`NP. NP. NP. NP. NP. NP. NP. NP. NP.`<br>
66+
`NP repeated 42 times in different colors.`
67+
68+
69+
## Additional Resources
70+
71+
- [W3C Alt Text Decision Tree](https://www.w3.org/WAI/tutorials/images/decision-tree/)
72+
- [WebAIM Alternative Text](https://webaim.org/techniques/alttext/)

docs/code-review/checklists/media.md

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

33
See [Working with Images](../../development/images.md) for full documentation on image helpers and optimization.
44

5+
- [ ] Always include `alt` attribute on images, even if it's blank
56
- [ ] Has alt text where applicable
67
- [ ] All images in a `srcset` can be loaded
78
- [ ] Use [image helpers](../../development/images.md) (`static()`, `resp_img()`, `picture()`, `l10n_img()`)

docs/images/alt-text/floor.jpg

103 KB
Loading

docs/images/alt-text/np.jpg

95.1 KB
Loading

docs/images/alt-text/qrcode.png

396 KB
Loading
427 KB
Loading

docs/images/alt-text/small.jpg

28.6 KB
Loading

docs/images/alt-text/surman.png

448 KB
Loading

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ nav:
180180
- Local Setup: cms/setup.md
181181
- Creating Pages: cms/pages.md
182182
- Images: cms/images.md
183+
- Writing Alt Text: cms/alt-text.md
183184
- Localization: cms/l10n.md
184185

185186
- Operations:

0 commit comments

Comments
 (0)