nuxt / icon

The <Icon> component, supporting Iconify, Emojis and custom components.
https://stackblitz.com/edit/nuxt-icon-playground?file=app.vue
MIT License
961 stars 59 forks source link

add SVGO implementation to optimize and clean SVGs #196

Open Neoniq opened 4 months ago

Neoniq commented 4 months ago

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

antfu commented 4 months ago

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

Neoniq commented 4 months ago

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

awacode21 commented 3 months ago

svgo for custom icon collection would be appreciated

Blackskyliner commented 2 months ago

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