You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

accessible-emoji.md 808 B

3 years ago
1234567891011121314151617181920212223
  1. # accessible-emoji
  2. Emoji have become a common way of communicating content to the end user. To a person using a screenreader, however, he/she 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.
  3. #### Resources
  4. 1. [Léonie Watson](http://tink.uk/accessible-emoji/)
  5. ## Rule details
  6. This rule takes no arguments.
  7. ### Succeed
  8. ```jsx
  9. <span role="img" aria-label="Snowman">&#9731;</span>
  10. <span role="img" aria-label="Panda">🐼</span>
  11. <span role="img" aria-labelledby="panda1">🐼</span>
  12. ```
  13. ### Fail
  14. ```jsx
  15. <span>🐼</span>
  16. <i role="img" aria-label="Panda">🐼</i>
  17. ```