webpack-contrib / svg-inline-loader

Inline SVG loader with cleaning-up functionality
MIT License
492 stars 59 forks source link

inline styles? #65

Open stevemao opened 7 years ago

stevemao commented 7 years ago

I have a few svgs and they have the same classes .cls-1 and/or .cls-2. They overwrite each other's style. If they could be auto inlined that would be great!

<defs>
  <style>
    .cls-1 {
      fill: #3d5a98;
    }

    .cls-2 {
      fill: #fff;
    }
  </style>
</defs>
kinetifex commented 7 years ago

@stevemao You can use the classPrefix option to avoid overwriting styles. See https://github.com/webpack-contrib/svg-inline-loader#classprefix-boolean--string

stevemao commented 7 years ago

@kinetifex I'll give it a shot! Looks like it's working. Cheers!