FWeinb / grunt-svgstore

Merge svgs from a folder
MIT License
919 stars 94 forks source link

Add a class to each symbol #51

Closed Macxim closed 10 years ago

Macxim commented 10 years ago

Hi,

Would it be possible to generate a class for each symbol? In a similar way you do it to add the prefix to each ID. I think it would be useful to target specific items and avoid styling with IDs.

What do you think?

SubZane commented 10 years ago

You can add a class to the svg element like this and set the css style on .my-svg-shape

  <svg class="my-svg-shape">
    <use xlink:href="svgsprite.svg#shape-arrow-up"></use>
  </svg>

does that help?

Macxim commented 10 years ago

Yes, that helps. I figured out later, I should have close this in that moment. Thanks for pointing that out.