Downloading Fonts

download

With this option you can download css and google sources for your local project. This means that your project will not depend on these external resources.

  • Type: Boolean
  • Default: true
nuxt.config.ts
export default {
  googleFonts: {
    download: false
  }
}

base64

This option encodes the fonts and inject directly into the generated css file.

  • Type: Boolean
  • Default: false
nuxt.config.ts
export default {
  googleFonts: {
    base64: true
  }
}

inject

This option injects the globally generated css file.

  • Type: Boolean
  • Default: true
nuxt.config.ts
export default {
  googleFonts: {
    inject: false
  }
}

overwriting

This option prevents files from being downloaded more than once.

  • Type: Boolean
  • Default: false
nuxt.config.ts
export default {
  googleFonts: {
    overwriting: true
  }
}

outputDir

Specifies the output directory for downloaded files.

  • Type: String
  • Default: 'node_modules/.cache/nuxt-google-fonts'
nuxt.config.ts
export default {
  googleFonts: {
    outputDir: 'assets'
  }
}

stylePath

Specifies the path of the generated stylesheet file.

  • Type: String
  • Default: 'css/nuxt-google-fonts.css'
nuxt.config.ts
export default {
  googleFonts: {
    stylePath: 'assets/google-fonts.css'
  }
}

fontsDir

Specifies the directory where the fonts will be downloaded.

This option is used if the base64 option is disabled.
  • Type: String
  • Default: 'fonts'
nuxt.config.ts
export default {
  googleFonts: {
    fontsDir: 'assets/fonts'
  }
}

fontsPath

Specifies the path of the fonts within the generated css file.

This option is used if the base64 option is disabled.
  • Type: String
  • Default: '../fonts'
nuxt.config.ts
export default {
  googleFonts: {
    fontsPath: 'fonts'
  }
}