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: false

nuxt.config.js
googleFonts: {
  download: true
}

base64

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

Type: Boolean Default: true

nuxt.config.js
googleFonts: {
  download: true,
  base64: true
}

inject

This option injects the globally generated css file.

Type: Boolean Default: true

nuxt.config.js
googleFonts: {
  download: true,
  inject: true
}

overwriting

This option prevents files from being downloaded more than once.

Type: Boolean Default: false

nuxt.config.js
googleFonts: {
  download: true,
  overwriting: false
}

outputDir

Specifies the output directory for downloaded files.

Type: String Default: this.options.dir.assets

nuxt.config.js
googleFonts: {
  download: true,
  outputDir: this.options.dir.assets
}

stylePath

Specifies the output directory for downloaded files.

Type: String Default: 'css/fonts.css'

nuxt.config.js
googleFonts: {
  download: true,
  stylePath: 'css/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.js
googleFonts: {
  download: true,
  base64: false,
  fontsDir: '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: '~assets/fonts'

nuxt.config.js
googleFonts: {
  download: true,
  base64: false,
  fontsPath: '~assets/fonts'
}
Edit this page on GitHub Updated at Mon, Mar 29, 2021