From 57f80e72fcbdc6cab6b438ac330ff05e6a78fe62 Mon Sep 17 00:00:00 2001 From: DCsunset Date: Sat, 18 Jul 2020 01:32:02 -0700 Subject: [PATCH] feat(frontend): locally serve fonts and icons --- frontend/assets/variables.scss | 2 ++ frontend/nuxt.config.js | 7 +++++++ frontend/package-lock.json | 10 ++++++++++ frontend/package.json | 4 +++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend/assets/variables.scss b/frontend/assets/variables.scss index f60e609..2c0c4c9 100644 --- a/frontend/assets/variables.scss +++ b/frontend/assets/variables.scss @@ -2,3 +2,5 @@ // // The variables you want to modify // $font-size-root: 20px; + +$body-font-family: 'Open Sans', sans-serif !default; diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index ecb2cbe..1cece6f 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -33,6 +33,10 @@ export default { ** Global CSS */ css: [ + // mdi font + '@mdi/font/css/materialdesignicons.css', + // main font + 'typeface-open-sans/index.css' ], /* ** Plugins to load before mounting the App @@ -95,6 +99,9 @@ export default { ** https://github.com/nuxt-community/vuetify-module */ vuetify: { + defaultAssets: false, + customVariables: ['~/assets/variables.scss'], + treeShake: true // to make customVariables work in dev }, /* ** Build configuration diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 16c92cb..c5e7424 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -960,6 +960,11 @@ "resolved": "https://registry.npm.taobao.org/@csstools/convert-colors/download/@csstools/convert-colors-1.4.0.tgz", "integrity": "sha1-rUldxBsS511YjG24uYNPCPoTHrc=" }, + "@mdi/font": { + "version": "5.3.45", + "resolved": "https://registry.npmjs.org/@mdi/font/-/font-5.3.45.tgz", + "integrity": "sha512-SD5d2vHEKRvDCInZQFXOwiFpBlzpuZOiqwxKf6E+zCt7UDc52TUSrL0+TXqY57VQh/SnTpZVXM+Uvs21OdPFWg==" + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npm.taobao.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.3.tgz", @@ -11184,6 +11189,11 @@ "resolved": "https://registry.npm.taobao.org/typedarray/download/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, + "typeface-open-sans": { + "version": "0.0.75", + "resolved": "https://registry.npmjs.org/typeface-open-sans/-/typeface-open-sans-0.0.75.tgz", + "integrity": "sha512-0lLmB7pfj113OP4T78SbpSmC4OCdFQ0vUxdSXQccsSb6qF76F92iEuC/DghFgmPswTyidk8+Hwf+PS/htiJoRQ==" + }, "typescript": { "version": "3.8.3", "resolved": "https://registry.npm.taobao.org/typescript/download/typescript-3.8.3.tgz?cache=0&sync_timestamp=1593586221215&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-3.8.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index b58f40d..3355cdd 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,6 +11,7 @@ "lint": "eslint --fix --ext .ts,.js,.vue ." }, "dependencies": { + "@mdi/font": "^5.3.45", "@nuxt/typescript-runtime": "^0.4.10", "@nuxtjs/axios": "^5.11.0", "@nuxtjs/proxy": "^2.0.0", @@ -19,7 +20,8 @@ "lodash": "^4.17.19", "moment": "^2.27.0", "nuxt": "^2.13.0", - "nuxt-typed-vuex": "^0.1.19" + "nuxt-typed-vuex": "^0.1.19", + "typeface-open-sans": "0.0.75" }, "devDependencies": { "@nuxt/typescript-build": "^1.0.3",