didierfranc / gatsby-plugin-google-fonts

Bring Google Fonts to Gatsby https://www.gatsbyjs.org/
MIT License
88 stars 18 forks source link

Specifying font names #8

Open kkollman opened 6 years ago

kkollman commented 6 years ago

I have a problem trying to specify a certain google font name; I have added the plugin to gatsby.config, changed the names of the default placeholder values, yet when I call font-family: 'myfont' it's not being rendered. TBH, the documentation isn't most descriptive - it could have an example setup for dummies 😂

my example config:

module.exports = {
  siteMetadata: {
    title: 'My App',
  },
  plugins: [
    'gatsby-plugin-react-helmet',
    `gatsby-plugin-sass`,
    {
      resolve: `gatsby-plugin-google-fonts`,
      options: {
        fonts: [
          `montserrat`,
          `roboto\:300,400,400i,700`
        ]
      }
    }
  ],
}

Neither 'roboto' nor 'montserrat' are working. I have tried different spelling (lower/uppercase first letter), no effect.

jodiedoubleday commented 4 years ago

I managed to get Montserrat\:500,600,700,800,900 working okay