I am trying to build an app using Nuxt, Firebase and Vuetify. I am a novice developer and will appreciate kind help on the below issue.
I can not add Google Fonts (lastly tried Bellefair)or change global default font-size to my Nuxt with Vuetify project. My nuxt.config.js
is below. Also I cannot change the default font size. I have tried various snippets I have found around but none seemed to work so far. I have lastly reached the below, but still to no success.
import colors from "vuetify/es5/util/colors";
export default {
mode: "spa",
head: {
titleTemplate: "%s - " + process.env.npm_package_name,
title: process.env.npm_package_name || "",
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
hid: "description",
name: "description",
content: process.env.npm_package_description || ""
}
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }, {
rel: "stylesheet", href:"https://fonts.googleapis.com/css?family=Bangers|Bellefair"
}]
},
loading: "@/components/loading",
css: [],
plugins: ["@/plugins/fireauth.js"],
buildModules: ["@nuxtjs/vuetify"],
modules: [
"@nuxtjs/axios",
"@nuxtjs/pwa",
"@nuxtjs/date-fns"
],
router: {
middleware: "fb-auth"
},
axios: {},
vuetify: {
customVariables: ["~assets/styles/variables.scss"],
theme: {
light: true,
themes: {
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
}
}
}
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {}
}
};
and my ~assets/styles/variables.scss
file is:
$body-font-family: "Bellefair", sans-serif;
$font-size-root: 20px;
@font-face {
font-family: "Bellefair";
src: url("https://fonts.googleapis.com/css?family=Bellefair");
}
body {
font-family: "Bellefair", sans-serif;
}
EDITED: //\//\//\//\//\//\ I found a solution to my own question:
I added= css: ['~/assets/styles/my-custom-styles.css'] to my nuxt.config.js and in that file
div {
font-family: "Montserrat", sans-serif;
font-size: 18px;
}
Also, I realized that my nuxt.config.js header does not need the stylesheet link to googleapis.com.
Sorry about taking space here but am always welcome to see better responses...