-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to import icons to be available as css classes #117
Comments
It's rather hard to answer your question 😄 The better way is to not do, what you're doing. Basically you are loading two instances of FontAwesome library: one is used by Mixing both ways in the same application is neither supported nor recommended. I would recommend to either stick with only fontawesome-free/pro (which is a new name of You can also try playing with:
to make single instance of library do both jobs... but this is not recommended usage either. |
😢 eh, not good... I'm surprised no one had this problem before. |
Sorry! PS You can also check, maybe your UI library supports passing icons as SVG string (Material does it). This way you can use |
Almost 100% they not support it. At least not yet. I'm using PrimeNG and want to set menu icons. |
Yeah, this seems to be the feature request: primefaces/primeng#4588. You may also try to poke PrimeNG team there! |
In my project I use UI libs that allow icon customization by providing string with icon css class definition. For example
'fa fa-user'
. Such string will end up in class of the span or i tag in html. How to import and register icons to global space to be available from html as class?So far I found workaround:
In module:
In component
I needed to use @fortawesome/fontawesome because somehow its library.add works as I want it. Also conflicting types must be casted to avoid TS compalints.
Is there a better way to do it ?
The text was updated successfully, but these errors were encountered: