grunt-svgstore
grunt-svgstore copied to clipboard
optional png fallback option
What do you think of an option to generate SVG with <image>
-tag that provide the png fallback?
resources:
- http://lynn.ru/examples/svg/en.html
- http://css-tricks.com/svg-fallbacks/
This looks like a great way to have a fallback image. I will look into how to generate images from SVG's within node. But I am not quite sure if this is in the scope of this plugin.
Maybe this would be better to include in the best practices guide in #22? I agree that this is probably out of the scope of the plugin. Not having it doesn't preclude people from doing it; you could easily make your workflow look like: [png fallback plugin] > ./tmp/icon.svg > svgmin > icon.min.svg > svgstore > defs.svg
This is exactly what I'm thinking. But there is still the need to write such a png fallback plugin.
If you choose SVG-Export on icomoon.io you can optional generate png's. So this is maybe not the solution but a workaround to get the png's easily.
http://www.grumpicon.com looks also really cool
I'm using this plugin for png fallbacks https://github.com/dbushell/grunt-svg2png. Seems to work fine, only started working with it today though.
~~Might want to consider this polyfill, that creates PNGs on the fly.~~ ~~https://github.com/jonathantneal/svg4everybody~~ ~~This would be especially useful if you're styling the SVG with CSS.~~
I was wrong about polyfill, it doesn't generate PNGs, it just changes the src attribute if your browser doesn't support it.
+1 for integrating a png-fallback
+1 for png fallback for IE8 and below
-1 as long as this means a dependency (directly or indirectly) to PhantomJS or any other heavy weight module.