adobe / aem-lib

Apache License 2.0
2 stars 7 forks source link

feat: add alt text support to decorateIcon #26

Closed fkakatie closed 10 months ago

fkakatie commented 10 months ago

Description

Moving @bstopp's PR from aem-boilerplate.

Opting for an empty alt attribute here in lieu of setting role attribute to presentation based on recommendations from Web Hypertext Application Technology Working Group and the Web Accessibility Initiative.

The Worldwide Web Consortium provides an example for the use of role="presentation":

An image that is in a container with the img role and where the full text alternative is available and is marked up with aria-labelledby and (if needed) aria-describedby;

Where, in this instance, we don't meet that threshold without the "full text alternative" in this specific implementation.

Related Issue

18

Motivation and Context

"The Lighthouse output results in a "Links do not have a discernible name" accessibility error which reduces the score" — @dave-fink

"By default, all icons would be purely decorative (most cases), but projects could opt-in to individually override icons they know should be descriptive either in their blocks or in the auto-blocking function." — @ramboz

How Has This Been Tested?

/test/decorate/decorateIcon.test.html

Types of changes

Checklist:

kptdobe commented 10 months ago

:tada: This PR is included in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: