Reputation: 622
Just overwrite the $body-font-family
like the documentation says doesn't work.
Upvotes: 0
Views: 1329
Reputation: 622
In nuxt.config.js
:
vuetify: {
customVariables: ['~/assets/variables.scss'],
treeShake: true, // IMPORTANT
....
font: {
family: 'AnotherFont'
},
},
In assets/variables.scss
:
// Overwrite the default variable
$body-font-family: 'AnotherFont', sans-serif !default;
If you want to include the Google Fonts locally for offline use:
Install the nuxt/google-fonts module: npm install --save-dev @nuxtjs/google-fonts
In nuxt.config.js
:
buildModules: [
'@nuxtjs/google-fonts'
...
],
...
vuetify: {
customVariables: ['~/assets/variables.scss'],
treeShake: true, // IMPORTANT
defaultAssets: false, // Disable the automatic load from online CDN
...
},
...
// Download the google fonts
googleFonts: {
download: true,
stylePath: 'css/fonts.css',
families: {
AnotherFont: true,
}
}
In assets/variables.scss
:
// Overwrite the default variable
$body-font-family: 'AnotherFont', sans-serif !default;
I won't link any documentaion page, because this part of the Nuxt documentation is ambiguous and misses several points.
IMPORTANT NOTES:
Upvotes: 2