Pavliko / postcss-svg

PostCSS plug-in which to insert inline SVG to CSS and allows you to manage it colors.
http://pavliko.github.io/postcss-svg/
Creative Commons Zero v1.0 Universal
124 stars 23 forks source link

support for fragment identifier #22

Closed maddesigns closed 7 years ago

maddesigns commented 9 years ago

is it possible to support fragment identifiers for own SVG sprites?

this works for evil icons

  background-image: svg("ei#sc-github");

but not for other SVG sprites

nishsinghal commented 8 years ago

Seems to work but only if you first generate the full sprite file:

This doesn't work:

background: svg("sprite.svg#github");

This works:

background: svg("sprite.svg");
background: svg("sprite.svg#github");

Would be nice if there was a better way to do this as this will bloat up the CSS file considerably.

dannybrown73 commented 8 years ago

I can't seem to get this to work with my own sprites as well...only evil icons. Double load trick above does not work either for some reason. Is there a particular type of sprite that we should use? Symbol, view, stacked...etc? Any help or examples of it working with your own sprites would be greatly appreciated.

in-in commented 8 years ago

@nishsinghal Not working for me also. Please share more details about your workaround. Which options you use?

jonathantneal commented 7 years ago

Fragment support is now in v2.