Gatsby Typography Google Fonts
Enter gatsby-plugin-prefetch-google-fonts which prefetches and downloads Google Fonts as opposed to loading them from Googles external stylesheet.
Gatsby typography google fonts. Can increase performance as opposed to loading webfonts from Googles external stylesheet. Download them for use in your digital products for Android iOS and web. Open your terminal window and navigate to your project directory and run the following command.
Google Fonts is a library of 1064 free licensed font families and APIs for conveniently using the fonts via CSS and Android. Npm install typography react-typography gatsby-plugin-typography. These are ideal for server-rendering.
TypographyStyle creates a style element and inserts the generated CSS for your theme. By using gatsby-plugin-typography and specifying the path to your typographyjs file via the pathToConfigModule option see below the inclusion of your typography styles and any relevant fonts is taken care of by a pair of helper methods under the hood keeping your typography-related config in a single location and your entry file sparse. Once installed and configured properly it prefetches and download for you the Google Font you want instead of loading it from Googles external stylesheet.
The plugin you need is called gatsby-plugin-prefetch-google-fonts. For when you want to use a font from a service like Google Fonts or Typekit Web Fonts. When you do that you can reduce the loading of your application often by 1 second on 3G connections.
To include it in your project you must install the plugin. Npm i --save gatsby-plugin-prefetch-google-fonts. We also provide delightful beautifully crafted icons for common actions and items.
Gatsby-plugin-typography will need to also include peer-dependencies of typography and react-typography. A Gatsby plugin to download and prefetch Google Fonts. GoogleFont creates the link element to include the Google Fonts weights specified in your theme.