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

Add aria_hidden option #79

Merged
merged 1 commit into from
Oct 16, 2017
Merged

Conversation

seanpdoyle
Copy link
Contributor

Closes #72.

Sometimes SVGs are simply decorative and therefore should be removed
from the accessibility tree. Here’s an example:

<p>
  <%= inline_svg "checkmark-icon.svg" %>
  Success!
</p>

You can imagine this as a simple flash message, letting the user know
that their action succeeded. We have the word ‘Success’, preceded by a
checkmark icon to visually represent the state.

In such a situation, the icon is simply decorative; it’s repeating
content already conveyed by the word ‘Success.’ If we apply
aria-hidden="true" to the SVG, we can remove it from the accessibility
tree and avoid the repetition.

Closes [jamesmartin#72].

Sometimes SVGs are simply decorative and therefore should be removed
from the accessibility tree. Here’s an example:

```erb
<p>
  <%= inline_svg "checkmark-icon.svg" %>
  Success!
</p>
```

You can imagine this as a simple flash message, letting the user know
that their action succeeded. We have the word ‘Success’, preceded by a
checkmark icon to visually represent the state.

In such a situation, the icon is simply decorative; it’s repeating
content already conveyed by the word ‘Success.’ If we apply
`aria-hidden="true"` to the SVG, we can remove it from the accessibility
tree and avoid the repetition.

[jamesmartin#72]: jamesmartin#72
Copy link
Owner

@jamesmartin jamesmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for taking the time to implement this feature! 👍 ✨

@jamesmartin jamesmartin merged commit 456e494 into jamesmartin:master Oct 16, 2017
@seanpdoyle seanpdoyle deleted the aria-hidden branch October 16, 2017 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants