Hacktoberfest In the global-style.js file I’m creating a theme object to hold all the values for the theme. The Gatsby Default Starter comes with this component and its related style sheet out of the box. Next, add the typeface name to the appropriate font-family value in your CSS. Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Using Font Awesome icons with React projects (which Gatsby is built on) is a pretty straight-forward process. Thanks. However, importing via page component (index.js), or gatsby-browser.js are viable alternatives. Most of us have probably used Google Fonts for its ease of use and wide range of available typefaces. The main idea of Chronoblog is to allow you not only to write a personal blog, but also to keep a record of everything important that you have done. When you choose some fonts from the Google fonts library, the recommended way to load them is to either add a link tag in the head of your HTML: or use the @import rule inside your CSS: After that, you can use the fonts by referencing them in your CSS: When we specify the link or the @import rule, what we download first is a small CSS file with the @font-facedefinitions for our fonts. WebP is a modern image format that provides both lossless and lossy compression for images on the web. react-fontawesome; Include the CSS files; For the last option, you must move the css and fonts in pages folder and then include fa in your js file. Below is the sample config and explanation for each of the options available. It is recommended you import it via the layout template (layout.js). Here is a ready-to-use Gatsby starter with Styled Components, ESLint, SEO optimization and more. Run in this on your Gatsby project’s root folder like so: npm install gatsby-plugin-google-fonts. With the help of a friend, what solved the issue was putting the