Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Icons like Font Awesome in Gatsby

I want to use Font Awesome Icons in my Gatsby project. I would love to include font awesome with a CDN.

Just including it in a script tag doesn't work. I think I need to import it with import ... from '../fontawesome.css' but i am not able to get this working and also wanted to use a cdn for that. Or do I need to parse it with a css library for gatsby?

Please give me advice or hints how to do it.

like image 994
Jobeso Avatar asked Oct 19 '17 16:10

Jobeso


People also ask

What is the difference between glyph icons and font awesome?

Font Awesome is a font and icon toolkit based on CSS and Less. Glyphicons are icon fonts which you can use in your web projects.


1 Answers

For anyone visiting this page in late 2018+, I would highly recommend using react-icons.

import { FaBeer } from 'react-icons/fa';  class Question extends React.Component {     render() {         return <h3> Lets go for a <FaBeer />? </h3>     } } 
like image 59
sntnupl Avatar answered Sep 17 '22 16:09

sntnupl