Skip to content

Commit 23719e2

Browse files
committed
Clarify accessibility notes for button labels.
1 parent 6d9ad21 commit 23719e2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,14 @@ those will utilize the first link in the contents.
104104
that needs to be described, consider placing it below the heading. If it's at the top with an alt text,
105105
it may be confusing for screen readers if it comes before the title of the card.
106106
- **Centered text** can be harder to read, so avoid longer card text that's centered.
107-
- Make sure **links and buttons** are descriptive, using `ilw-sr-only` if needed to add context.
107+
- Make sure **links and buttons** are descriptive, using `ilw-sr-only` if needed to add context. For example:
108+
109+
```html
110+
<a href="#" class="ilw-button">Learn More <span class="ilw-sr-only">About Cards</span></a>
111+
```
112+
113+
Note that [WCAG Label in Name](https://www.w3.org/WAI/WCAG21/Understanding/label-in-name) specifies that the
114+
name and label must begin with the same words, so the hidden portion should be at the end.
108115

109116
## External References
110117

0 commit comments

Comments
 (0)