tabler / tabler-icons

A set of over 5400 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
17.84k stars 886 forks source link

`@tabler/icons-svelte` icons `size` and `stroke` props typed incorrectly #801

Open iolyd opened 12 months ago

iolyd commented 12 months ago

The IconProps interface is typed incorrectly and ends up being too zealous with only accepting number values for size and stroke. Looking at how the props are used within the components, passing string values to either of these should be considered valid. For example:

<IconMoon size="1em" stroke="2px" />

consists of valid prop values in the scope of SVG attributes, and actually works as is although it makes typescript cry no-no.

chjlsch commented 11 months ago

Hotfix: @abineo/svelte-icons. Should be a drop in replacement, except that size is set to 1em (font size).

iolyd commented 11 months ago

@christoph-jeanluc-schneider good idea with that fork. I ended up switching to https://github.com/lucide-icons/lucide due to the standing issue with dev/build slowdowns with tabler-icons.