moving vuetify configuration to "middleware"
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
const config = require('./server/config.js')
|
||||
const minifyTheme = require('minify-css-string').default
|
||||
const locales = require('./locales/index')
|
||||
|
||||
import { ca, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, ru, zhHans } from 'vuetify/lib/locale'
|
||||
|
||||
const isDev = (process.env.NODE_ENV !== 'production')
|
||||
module.exports = {
|
||||
@@ -142,27 +140,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
buildModules: ['@nuxtjs/vuetify'],
|
||||
vuetify: {
|
||||
lang: { locales: { ca, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, ru, zhHans } },
|
||||
treeShake: true,
|
||||
theme: {
|
||||
options: {
|
||||
customProperties: false,
|
||||
variations: false,
|
||||
minifyTheme,
|
||||
},
|
||||
dark: true,
|
||||
themes: {
|
||||
dark: {
|
||||
primary: '#FF6E40'
|
||||
},
|
||||
light: {
|
||||
primary: '#FF4500'
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultAssets: false
|
||||
},
|
||||
vuetify: { optionsPath: './vuetify.options.js' },
|
||||
build: {
|
||||
extend(config, { isDev, isClient }) {
|
||||
// ..
|
||||
|
||||
51
vuetify.options.js
Normal file
51
vuetify.options.js
Normal file
@@ -0,0 +1,51 @@
|
||||
// import { ca, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, ru, zhHans } from 'vuetify/lib/locale'
|
||||
// lang: { locales: { ca, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, ru, zhHans } },
|
||||
// treeShake: true,
|
||||
// theme: {
|
||||
// options: {
|
||||
// customProperties: false,
|
||||
// variations: false,
|
||||
// minifyTheme,
|
||||
// },
|
||||
// dark: true,
|
||||
// themes: {
|
||||
// dark: {
|
||||
// primary: '#FF6E40'
|
||||
// },
|
||||
// light: {
|
||||
// primary: '#FF4500'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// defaultAssets: false
|
||||
// },
|
||||
|
||||
const minifyTheme = require('minify-css-string').default
|
||||
import { ca, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, ru, zhHans } from 'vuetify/es5/locale'
|
||||
|
||||
export default ({ res, nuxtState }) => {
|
||||
|
||||
const settings = process.server ? res.locals.settings : nuxtState.state.settings
|
||||
|
||||
return {
|
||||
lang: { locales: { ca, de, en, es, eu, fr, gl, it, nb, nl, pl, pt, sk, ru, zhHans } },
|
||||
treeShake: true,
|
||||
theme: {
|
||||
options: {
|
||||
customProperties: false,
|
||||
variations: false,
|
||||
minifyTheme,
|
||||
},
|
||||
dark: settings['theme.is_dark'],
|
||||
themes: {
|
||||
dark: {
|
||||
primary: settings['theme.primary'] || '#FF6E40'
|
||||
},
|
||||
light: {
|
||||
primary: settings['theme.primary'] || '#FF4500'
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultAssets: false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user