- #GREAT GATSBY FONT ON DAFONT HOW TO#
- #GREAT GATSBY FONT ON DAFONT INSTALL#
- #GREAT GATSBY FONT ON DAFONT CODE#
But, when it comes to 70s fonts, they were thick, creative, and outstanding. Hip Hop music also appeared in the late 70s.
#GREAT GATSBY FONT ON DAFONT HOW TO#
In this article, you were introduced to three different approaches for loading fonts onto a project: Typography.js, Fontsource, and managing self-hosted files manually.įinding the right solution for your needs can significantly improve performance and user experience.Ĭontinue your learning with How To Deploy a Gatsby Application to DigitalOcean App Platform.The 1970s are the golden era for vinyl records, Star Wars toys, and the first Apple computer. Src: url("Rubik-Bold.woff2") format("woff2"), url("Rubik-Bold.woff") format("woff") Īnd now you can call your fonts in the same way you did in the previous Fontsource example - via a stylesheet or styled-component. Src: url("Rubik-Italic.woff2") format("woff2"), url("Rubik-Italic.woff") format("woff") Src: url("Rubik.woff2") format("woff2"), url("Rubik.woff") format("woff") You can then source the directory with the help of the gatsby-source-filesystem plugin: Keeping with the previous Rubik example, you can create a directory for your font files and stylesheet: |- /static Whichever the case may be, you can always add fonts to a Gatsby site like you normally would with any website.
Or even try out some of the font loading strategies from Zach Leatherman. Maybe you want to take more advantage of the CSS Font Loading API. However, there may be situations where you want finer control over the setup. Managing Self-Hosted Files Manuallyįontsource is a self-hosting solution and provides the files you need. Now your Gatsby project supports Fontsource. Theme.overrideThemeStyles = () => () => ( Import theme from "typography-theme-lawton" Src/utils/typography.js import Typography from "typography"
#GREAT GATSBY FONT ON DAFONT CODE#
Next, open the gatsby-config.js file with your code editor and add the following new lines of code: It is possible to use the -legacy-peer-deps flag to get around this error. Note: At the time of revision, there was a dependency tree conflict with the latest version of React, gatsby-plugin-typography, and react-typography.
#GREAT GATSBY FONT ON DAFONT INSTALL#
The Typography,js section was verified with gatsby-plugin-typography v3.2.0, react-typography v0.16.19, typography v0.16.19, and typography-theme-lawton v0.16.19. This tutorial was verified with Node v15.13.0, npm v7.8.0, gatsby v3.2.1, and react v17.0.1. The Gatsby started created in How To Set Up Your First Gatsby Website satisfies this requirement.