grunt-svgstore icon indicating copy to clipboard operation
grunt-svgstore copied to clipboard

optional png fallback option

Open m5o opened this issue 10 years ago • 10 comments

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/

m5o avatar Jun 04 '14 16:06 m5o

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.

FWeinb avatar Jun 11 '14 19:06 FWeinb

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

djmadeira avatar Jun 20 '14 14:06 djmadeira

This is exactly what I'm thinking. But there is still the need to write such a png fallback plugin.

FWeinb avatar Jun 20 '14 14:06 FWeinb

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.

m5o avatar Jun 20 '14 14:06 m5o

http://www.grumpicon.com looks also really cool

m5o avatar Jul 17 '14 22:07 m5o

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.

codekipple avatar Aug 11 '14 10:08 codekipple

~~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.

iansoper avatar Sep 26 '14 02:09 iansoper

+1 for integrating a png-fallback

ghost avatar Sep 29 '14 14:09 ghost

+1 for png fallback for IE8 and below

IschaGast avatar Oct 20 '14 10:10 IschaGast

-1 as long as this means a dependency (directly or indirectly) to PhantomJS or any other heavy weight module.

masi avatar Dec 04 '15 14:12 masi