|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1016 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | # jsx-a11y/accessible-emoji
|
|---|
| 2 |
|
|---|
| 3 | ❌ This rule is deprecated.
|
|---|
| 4 |
|
|---|
| 5 | <!-- end auto-generated rule header -->
|
|---|
| 6 |
|
|---|
| 7 | Emoji have become a common way of communicating content to the end user. To a person using a screen reader, however, they may not be aware that this content is there at all. By wrapping the emoji in a `<span>`, giving it the `role="img"`, and providing a useful description in `aria-label`, the screen reader will treat the emoji as an image in the accessibility tree with an accessible name for the end user.
|
|---|
| 8 |
|
|---|
| 9 | ## Rule details
|
|---|
| 10 |
|
|---|
| 11 | This rule takes no arguments.
|
|---|
| 12 |
|
|---|
| 13 | ### Succeed
|
|---|
| 14 | ```jsx
|
|---|
| 15 | <span role="img" aria-label="Snowman">☃</span>
|
|---|
| 16 | <span role="img" aria-label="Panda">🐼</span>
|
|---|
| 17 | <span role="img" aria-labelledby="panda1">🐼</span>
|
|---|
| 18 | ```
|
|---|
| 19 |
|
|---|
| 20 | ### Fail
|
|---|
| 21 | ```jsx
|
|---|
| 22 | <span>🐼</span>
|
|---|
| 23 | <i role="img" aria-label="Panda">🐼</i>
|
|---|
| 24 | ```
|
|---|
| 25 |
|
|---|
| 26 | ## Accessibility guidelines
|
|---|
| 27 | - [WCAG 1.1.1](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
|
|---|
| 28 |
|
|---|
| 29 | ### Resources
|
|---|
| 30 | - [Léonie Watson, Accessible Emoji](https://tink.uk/accessible-emoji/)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.