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

Transform for common aria attributes #34

Merged
merged 3 commits into from
May 3, 2016
Merged

Transform for common aria attributes #34

merged 3 commits into from
May 3, 2016

Conversation

jamesmartin
Copy link
Owner

Addresses #28.

This branch adds a new transform that, when enabled, adds the following accessibility attributes to the SVG:

  • role="img"
  • aria-labelledby="title desc" (only adds 'title' and 'desc' if elements exist in the document)

By default, this transformation is not active. It can be used as follows:

inline_svg("some_document.svg", title: "some title", desc: "some description" aria: true)

This results in the following (obviously, title and description are optional):

<svg role="img" aria-labelledby="title desc"><title>Some title</title><desc>Some description</desc>Some document</svg>

/cc @samjewell for requesting this feature

@jamesmartin jamesmartin merged commit c9e4ff6 into master May 3, 2016
@jamesmartin jamesmartin deleted the aria-transform branch May 3, 2016 07:04
@jamesmartin jamesmartin mentioned this pull request May 3, 2016
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.

1 participant