icon
icon copied to clipboard
add SVGO implementation to optimize and clean SVGs
https://github.com/svg/svgo
There are nuxt modules with support for SVGO but they are not working out of the box with nuxt/icon (or not working at all like https://nuxt.com/modules/svg-sprite)
So i think it is good addition to already most perfect module
I myself find it frustrating to fix fill and stroke to be of currentColor. SVGO can do it for me just fine
Iconify icons should already be optimized. Do you mean for the custom svg icons? If in that case, I think it would make sense to have that. PR welcome if anyone wants to work on that. Thanks
Yes for custom icons of course. I'm seeing nuxt icons becomes kinda all in one solution, because it is close enough for me already
svgo for custom icon collection would be appreciated
We could just use the iconify tools and while/after parsing them into the collection we could just pipe them through cleanSVG and runSVGO. Also adding the corresponding options to our configuration.
See: https://iconify.design/docs/libraries/tools/icon/cleanup.html and https://iconify.design/docs/libraries/tools/icon/svgo.html
Yes, I use usually SVGO to remove the fill and stroke attributes using svgo, and apply a svg { fill: currentColor } globally in my CSS.
I see I can get the same effect using the customize function, but I'd prefer the svgo approach as this is how vue-svg-inline-loader and vite-svg-loader works, so it would be uniform across my vue, inertia.js and nuxt projects