nuxt-modules / svg-sprite

Optimize SVG files and combine them into sprite
https://codesandbox.io/s/github/nuxt-community/svg-sprite-module/
MIT License
301 stars 42 forks source link

How to add the viewBox attribute to a parent SVG #248

Open brnteka opened 3 years ago

brnteka commented 3 years ago

Hi, thank you for the module, but is it possible to copy the icons viewBox attribute to an SVG that holds it? I find it hard scaling icons, say if i set explicit height and width to auto, the icon would still be 300px(defaults value) wide. But if it had on it the same viewBox attribute as the icon itself it would be scaled properly.

brnteka commented 3 years ago

judging by the code it's not possible and that's a shame, the only way I could use this module with my icons library probably would be if all the icons shared the same viewBox, which i could pass to them via view-box property