x64Bits / solid-icons

The simplest way to use icons in SolidJS
https://solid-icons.vercel.app
MIT License
284 stars 18 forks source link

fix: tabler filled icons stroke-width being removed by svgo #42

Closed linkthai closed 1 year ago

linkthai commented 1 year ago

It seems like the Tabler Icons did some update with the filled icons. You can see the messed up filled icons on the Solid Icons website.

All its icons have the stroke-width=2 on the tag, and the all have their individual tags. svgo removes all the stroke attributes on non-svg tags, so the get inherited the stroke-width=2 instead of its own stroke-width=0 which was deleted.

This fix clone a new svgo config for Tabler only so it doesn't affect other icon packs. It specificially removes the removeAttributesBySelector plugin.

x64Bits commented 1 year ago

Excellent work 🙌🏼, one question, does this not conflict with the switch that we have below or would it not be better to address this with the switch that was just below the code that you have written?

linkthai commented 1 year ago

It doesn't conflict, the new switch addresses the optimize function, and the switch below addresses the normalize function.

The normalize function depends on the optimize output, so I have two options: call the optimize again with different options inside the TB case or apply condition to the main optimize.

The latter is the better option, I used switch instead of if in case there will be another pack that have different options for optimize in the future.

linkthai commented 1 year ago

@x64Bits I would appreciate it if you review and merge this branch soon, so I can use it for my current project.

x64Bits commented 1 year ago

I already check it this, sorry if it's taking me longer than expected, I hope to send a new version today with these corrections, the last versions I have sent have created more problems than existed. 🥲

linkthai commented 1 year ago

@x64Bits thank you, it works now. 🌞