3 ms·
SVGeezy - a JavaScript plugin for SVG fallbacks
- paranoiacblack 14y agoKudos to you benhowdle89. This is just what I was looking for recently since I've been trying to move old sites to support svgs. Also, digging the kanye quote.
- benhowdle89 14y agoThanks man!
- duopixel 14y agoGreat work. This is was sorely needed. May I ask why did you go with progressive enhancement instead of graceful degradation? Sort of like <img class="logo svg" src="logo.png" ... /> This would allow old clients with javascript disabled to still display the image, but I'm not sure if it would cause duplicate requests in modern browsers.
- benhowdle89 14y agoYou're right, I think it felt more natural to do it the way I did. If I did it in the above way, then the browser would DL the PNG then the JS would cause the browser to go DL the SVG. As a %, the browsers that do support SVGs are far greater than those that don't. So those people are still getting a great experience, but the SVG supporting browsers getting an even better one!
- cleverjake 14y agoPersonally, I prefer the way it is being done. A majority of sites that would catering to non-javascript clients wouldn't be using SVG on top of that. Secondly, this prevents a majority of A grade browsers from double downloading.
- pooriaazimi 14y agoIt's great, but you need to make it more customizable. I had an SVG logo once that would fail to render correctly on most browsers, even though they supported `SVG#BasicStructure`. Make it an option so we can decide what subset of SVG "each" image needs!
- pooriaazimi 14y agoAnd by subset, I mean "I need #BasicStructure, #ContainerAttribute, #Font and #Filter", so it sould be an array with "#BasicStructure" as the default. Edit: I'm beginning to like GitHub's issues, so I opened a ticket :) https://github.com/benhowdle89/svgeezy/issues/1 https://github.com/benhowdle89/svgeezy/issues/1