Permalink
Cannot retrieve contributors at this time
30 lines (21 sloc)
1014 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/eslint-plugin-jsx-a11y/docs/rules/accessible-emoji.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jsx-a11y/accessible-emoji | |
❌ This rule is deprecated. | |
<!-- end auto-generated rule header --> | |
Emoji have become a common way of communicating content to the end user. To a person using a screenreader, 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 screenreader will treat the emoji as an image in the accessibility tree with an accessible name for the end user. | |
## Rule details | |
This rule takes no arguments. | |
### Succeed | |
```jsx | |
<span role="img" aria-label="Snowman">☃</span> | |
<span role="img" aria-label="Panda">🐼</span> | |
<span role="img" aria-labelledby="panda1">🐼</span> | |
``` | |
### Fail | |
```jsx | |
<span>🐼</span> | |
<i role="img" aria-label="Panda">🐼</i> | |
``` | |
## Accessibility guidelines | |
- [WCAG 1.1.1](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html) | |
### Resources | |
- [Léonie Watson, Accessible Emoji](https://tink.uk/accessible-emoji/) |