gpp
gatsby-plugin-prefetch-google-fonts
npm i gatsby-plugin-prefetch-google-fonts
gpp

gatsby-plugin-prefetch-google-fonts

A Gatsby plugin to download and prefetch [Google Fonts](https://fonts.google.com/). Can increase performance as opposed to loading webfonts from Google's external stylesheet.

by Kennedy Rose

1.4.3 (see all)License:MITTypeScript:Not Found
npm i gatsby-plugin-prefetch-google-fonts
Readme

gatsby-plugin-prefetch-google-fonts

A Gatsby plugin to download and prefetch Google Fonts. Can increase performance as opposed to loading webfonts from Google's external stylesheet.

Installation

With npm:

npm install --save gatsby-plugin-prefetch-google-fonts

Or with Yarn:

yarn add gatsby-plugin-prefetch-google-fonts

Usage

In your gatsby-config.js file, load in the plugin along with which web fonts to load.

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-prefetch-google-fonts`,
      options: {
        fonts: [
          {
            family: `Oswald`,
            subsets: [`latin`],
          },
          {
            family: `Open Sans`,
            variants: [`400`, `700`]
          },
        ],
      },
    }
  ]
}

For a list of all available font family options, consult the google-fonts-plugin readme.

Downloads/wk

2.8K

GitHub Stars

0
No data available

LAST COMMIT

NaNyrs ago

MAINTAINERS

2

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
No data available
VersionTagPublished
1.4.3
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial