Skip to content

Commit a07bb2b

Browse files
committed
Move Google Fonts to @nuxtjs/google-fonts
Remove external @import URL lines from assets/scss/main.scss and add the @nuxtjs/google-fonts module and configuration in nuxt.config.ts (register Open Sans and Montserrat, set display: 'swap', download: true). Also add @nuxtjs/google-fonts to devDependencies in package.json. Centralizes font loading, enables local font download/optimization, and avoids inline external CSS imports.
1 parent f7c259f commit a07bb2b

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

assets/scss/main.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
2-
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
3-
41
@import "theme.scss";
52
@import "bootstrap/scss/bootstrap.scss";
63
@import "maplibre-gl/dist/maplibre-gl.css";

nuxt.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ export default defineNuxtConfig({
33
modules: [
44
'@bootstrap-vue-next/nuxt',
55
'@nuxt/eslint',
6+
'@nuxtjs/google-fonts',
67
'@sentry/nuxt/module',
78
],
9+
googleFonts: {
10+
families: {
11+
'Open Sans': [300, 400, 500, 600, 700, 800],
12+
Montserrat: [100, 300, 400, 500, 600, 700, 800, 900],
13+
},
14+
display: 'swap',
15+
download: true,
16+
},
817
ssr: false,
918
devtools: { enabled: true },
1019
app: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
},
3636
"devDependencies": {
3737
"@nuxt/eslint": "^1.12.1",
38+
"@nuxtjs/google-fonts": "^3.2.0",
3839
"@types/bootstrap": "^5.2.10",
3940
"@types/geojson": "^7946.0.16",
4041
"eslint": "^9.39.2",

0 commit comments

Comments
 (0)