Remove unused Font Awesome icons

前端 未结 3 1044
孤独总比滥情好
孤独总比滥情好 2021-02-07 08:48

I uploaded the files to my server but I\'m only using 5 icons in my site.

How can I delete the Font Awesome icons that I will never use? Like the useful and beautiful S

相关标签:
3条回答
  • 2021-02-07 09:02

    It sounds like you copied the entire font-awesome directory into your project, and this isn't the result you are looking for. If you only want 5 of the Font Awesome icons in your project, and not have the balance of icons available for future use, take a look at Fontello.

    Fontello is an icon fonts generator which allows you to pick and choose only the icon fonts you want for your project.

    Here's a link to Fontello on GitHub, with information on how to use it: https://github.com/fontello/fontello/wiki/Help

    0 讨论(0)
  • 2021-02-07 09:09

    Another option you have if you only need a few icons, it's IcoMoon where you can choose the icons that are going to be loaded only including the ones from Font-Awesome.

    Otherwise, check this blog that explains how to reduce font-awesome size.

    0 讨论(0)
  • 2021-02-07 09:17

    If you are using javascript module imports try:

    import { faCoffee } from '@fortawesome/free-solid-svg-icons/faCoffee' // <-- note the extra faCoffee there

    0 讨论(0)
提交回复
热议问题