Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Font Awesome Icon Local Library #387

Open
davidholyko opened this issue Aug 9, 2019 · 1 comment
Open

Font Awesome Icon Local Library #387

davidholyko opened this issue Aug 9, 2019 · 1 comment
Labels
low priority An issue that is nice to have but does not impact usability or necessary functionality

Comments

@davidholyko
Copy link
Collaborator

davidholyko commented Aug 9, 2019

we can increase the performance in this area by importing only the icons we plan to use at the root level instead of importing the entire FA icon library

@davidholyko davidholyko self-assigned this Aug 9, 2019
@RajChaudhry RajChaudhry added the low priority An issue that is nice to have but does not impact usability or necessary functionality label Aug 18, 2019
@davidholyko
Copy link
Collaborator Author

current index.js

library.add(fab, fas);

this add all the icons from the font-awesome basic and font-awesome solid libraries which is a lot to import. we can individually import the icons and that will help with performance

link to use an example: https://scotch.io/tutorials/using-font-awesome-5-with-react#toc-creating-an-icon-library

// import the library
import { library } from '@fortawesome/fontawesome-svg-core';

// import your icons
import { faMoneyBill } from '@fortawesome/pro-solid-svg-icons';
import { faCode, faHighlighter } from '@fortawesome/free-regular-svg-icons';

library.add(
  faMoneyBill,
  faCode,
  faHighlighter
  // more icons go here
);

@davidholyko davidholyko removed their assignment Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
low priority An issue that is nice to have but does not impact usability or necessary functionality
Projects
None yet
Development

No branches or pull requests

2 participants