Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon alt-text support #54

Closed
blackfalcon opened this issue Nov 29, 2022 · 0 comments · Fixed by #56
Closed

Icon alt-text support #54

blackfalcon opened this issue Nov 29, 2022 · 0 comments · Fixed by #56
Assignees
Labels
Type: Feature New Feature

Comments

@blackfalcon
Copy link
Member

blackfalcon commented Nov 29, 2022

Is your feature request related to a problem? Please describe.

Please see the following issue

Describe the solution you'd like

Given that there are some opportunities for icons to be read aloud to screen readers, e.g. the icons that appear in auro-hyperlink, aria-hidden is on the SVG itself, not on the auro-icon element. This will be addressed with the following issue.

It is incorrect to say that ALL images should have descriptive text. https://www2.gov.bc.ca/gov/content/home/accessible-government/toolkit/accessible-digital-content/graphics#decorative

It is also considered a failure to not marking up decorative images in HTML in a way that allows assistive technology to ignore them

Content producers and users of auro-icon should be educated to follow this W3C alt Decision Tree.

That being said, it's not Auro's call to enforce an opinion on that on whether that is read by screen readers or not. It is however our position to ensure that the end users do have a proper and informative experience.

For the auro-icon element, we cannot use alt="", as that is only allowed on images themselves, but we can use the title attribute.

On the div with the class="primary" we can add by default, aria-hidden="true". On the element itself, we would support the two new attributes,

  1. aria-hidden="false"
  2. title=" ... "

If aria-hidden="false" is used, this will remove the aria-hidden="true" on the inner div in the shadow DOM and allow for the title of the SVG to be read aloud.

If the title attribute is used, this will be picked up by the screen readers and the inner div will remain with aria-hidden="true".

Legacy support

The auro-icon element already has support for alt text. A user could add content in the slot of the element and this would be read aloud by screen readers.

While this works, it is a non-standard approach to a11y and SVGs. It is the recommendation that we do not remove this support, but we only deprecate it and remove the examples from the docs.

Exit criteria

This issue will be considered closed when,

  1. A user can use aria-hidden="false" and the contents of the SVG's title element is read aloud
  2. A user can add content via the title attribute and this will have precedence to be read aloud over the SVG's title element.
  3. The content of the SVG's title element is still visible on tool-tip
@blackfalcon blackfalcon added this to the a11y screen reader desc milestone Nov 30, 2022
@blackfalcon blackfalcon self-assigned this Nov 30, 2022
blackfalcon added a commit that referenced this issue Dec 21, 2022
Changes to be committed:
modified:   demo/demo.md
modified:   src/auro-icon.js
modified:   src/style.scss
blackfalcon added a commit that referenced this issue Dec 21, 2022
Changes to be committed:
modified:   test/auro-icon.test.js
@blackfalcon blackfalcon linked a pull request Dec 21, 2022 that will close this issue
6 tasks
jason-capsule42 pushed a commit that referenced this issue Dec 28, 2022
Changes to be committed:
modified:   demo/demo.md
modified:   src/auro-icon.js
modified:   src/style.scss
jason-capsule42 pushed a commit that referenced this issue Dec 28, 2022
Changes to be committed:
modified:   test/auro-icon.test.js
AuroDesignSystem pushed a commit that referenced this issue Dec 28, 2022
# [3.3.0](v3.2.0...v3.3.0) (2022-12-28)

### Bug Fixes

* **deps:** update dependencies ([f0ec641](f0ec641))

### Features

* **a11y toggle:** add new aria-hidden option [#54](#54) ([ed06dc5](ed06dc5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant