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

SVG hyperlink support #57

Open
bingenito opened this issue Jul 19, 2019 · 5 comments
Open

SVG hyperlink support #57

bingenito opened this issue Jul 19, 2019 · 5 comments

Comments

@bingenito
Copy link

Query param options to specify an overall link for the entire badge or split links for left and right. For dynamically generated tags, this will make usage from an object or embed element easier without having to further wrap img usage of the svg with another link as the link can be generated for you.

@bingenito
Copy link
Author

I can PR this but wanted to open for discussion first before surprise!

@amio
Copy link
Member

amio commented Jul 21, 2019

😅 Not sure if I get the correct idea, would you give an example usage of this?

@bingenito
Copy link
Author

@amio Using embed and object tags to embed svg within a page allows for more advanced svg.

<embed src="<url to svg>" />

This includes providing an icon via a url and not svg, or adding support for hyperlinks within the badge itself. A use case can be something like the github badges where it automatically embeds in the svg a link to the github project. Then when hosted within a page using embed or object, the link is auto generated and included rather than having to wrap the image itself in a link.

With that said, while playing around quite a bit the actual scenarios to be able to leverage this are so narrow that perhaps it isn't worth the effort. Most markdown sanitizes object and embed away so it leaves only manual html usage as a target. I'm starting to think the this small use case isn't worth the effort.

@amio
Copy link
Member

amio commented Jul 25, 2019

Agreed, sanitizers would be an issue to this in real world use cases.

While supporting link / labelLink / statusLink might be a meaningful feature for badgen library, if it can be achieved at a small cost.

@evelynhathaway
Copy link
Contributor

I'm going to chime with some accessibility tips for when this gets implemented since I just implemented some a11y changes to shields, which has link support.

  • The inner text of the link should be valid
  • The link should not be inside or have aria-hidden="true"
  • The role for the SVG should be the default or group
  • You may run into some issues with IE or NVDA

See: badges/shields#5289

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

No branches or pull requests

3 participants