alphapeter / fa-svelte

Font Awesome 5 for svelte.js
MIT License
71 stars 3 forks source link

Allow to pass the icon size #8

Closed moshfeu closed 4 years ago

moshfeu commented 4 years ago

Currently, the only option to change the size is to wrap the component with an element and set the font-size of it, for example:

<style>
  .icon {
    font-size: 30px
  }
</style>
<i class="icon">
  <Icon icon={faGasPump} />
</i>

I suggest to allow to pass the size in a prop. Maybe something like this: https://stackoverflow.com/a/57183208/863110

alphapeter commented 4 years ago

Hi! I've noticed that there is another project which supports what you ask for: https://cweili.github.io/svelte-fa/

I will currently keep this project as lightweight as possible, just providing the basic functionality for rendering simple font awesome icons. The fit for this library would be when you prioritize speed and size, thus the limitations.

Another appoach might be to have several components in the library, i.e. Icon - standard SizedIcon - icon which accepts size property like and so on...

For me, I tend to set the size of the icons using CSS

moshfeu commented 4 years ago

Thanks for the reply and the reference.