iconic / SVGInjector

Fast, caching, dynamic inline SVG DOM injection library
MIT License
975 stars 144 forks source link

[feature] title attribute transclusion #14

Open stryju opened 10 years ago

stryju commented 10 years ago

it would be good, if the injector could transclude the title attribute to the SVG, if possible (tho, some more work could be involved to properly implement that)

currently, the title just remains on SVG, but according to the SVG 1.1 specs, it would be better to use a <title> or <desc> element

WDYT?

protodave commented 10 years ago

I think that's a good idea... and currently have an open issue on iconic.js for figuring out what to do with the alt tag as well:

SVG spec does not define an alt attribute. Any alt attribute defined on the img tag could maybe be translated into title/desc tags or an aria-label attribute?

Iconic icons SVGs have a predefined SVG title tag built-in, so we'll need to think about how to handle pre-existing tags too (replace, merge?)