Skip to content

Commit

Permalink
feat: turn on font stylesheet inlining by default (#87)
Browse files Browse the repository at this point in the history
This commit enables the "download" option by default,
which turns on inlining of the font stylesheet and
the downloading/self-hosting of the font. As these
are both best practices, it makes sense for these
to be part of the default experience.

See more: https://web.dev/font-best-practices/#inline-font-declarations

Co-authored-by: Ricardo Gobbo de Souza <[email protected]>
  • Loading branch information
kara and ricardogobbosouza authored Jun 9, 2022
1 parent 1e50410 commit 8b53012
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const nuxtModule: Module<ModuleOptions> = function (moduleOptions) {
preconnect: true,
preload: false,
useStylesheet: false,
download: false,
download: true,
base64: false,
inject: true,
overwriting: false,
Expand Down
3 changes: 2 additions & 1 deletion test/fixture/basic/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default {
googleFonts: {
families: {
Roboto: true
}
},
download: false
}
}
1 change: 0 additions & 1 deletion test/fixture/download/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default {
'../../../src/module.ts'
],
googleFonts: {
download: true,
families: {
Roboto: true
}
Expand Down
Empty file.
1 change: 1 addition & 0 deletions test/fixture/use-stylesheet/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
Roboto: true
},
useStylesheet: true,
download: false,
preload: true
}
}

0 comments on commit 8b53012

Please sign in to comment.