【发布时间】:2021-03-11 15:34:24
【问题描述】:
默认的 vuetify 主题需要调整的属性数量非常有限。
dark: {
primary: '#3739FF',
accent: '#101721',
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
}
我想控制所有的背景颜色。
我尝试了 Dmitry Kaltovich 的答案
How To change theme colors on Nuxt/Vuetify starter template
通过这样的自定义 scss 文件
@import '~vuetify/src/styles/styles.sass';
$material-dark: map-merge(
$material-dark,
(
background: map-get($blue, 'lighten-5'),
)
);
和我这样的 nuxt 配置
vuetify: {
treeShake: true,
customVariables: ['~/assets/scss/vuetify.scss'],
theme: {
dark: true,
themes: {
options: {customProperties: true},
dark: {
primary: '#3739FF',
accent: '#101721',
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
}
}
}
},
但它不起作用。
我正在使用
"nuxt": "^2.14.6",
"@nuxtjs/vuetify": "^1.11.2",
"sass": "^1.29.0",
"sass-loader": "^7.3.1"
"fibers": "^5.0.0",
"node-sass": "^5.0.0",
【问题讨论】:
标签: vue.js sass nuxt.js vuetify.js