【发布时间】:2020-09-30 15:38:37
【问题描述】:
我在我的项目中使用了 Vuetify,我想使用一个变量文件来覆盖 Vuetify 生成的样式。
我正在使用 a-la-carte 方法加载组件及其相应的样式,因此我不会使用以下方法导入 Vuetify SASS 文件:
@import '~vuetify/src/styles/styles.sass'
// Not using this method because I don't want to generate styles that are not being used by
// vuetify components I'm not using
另外,我的项目使用的是*.scss,而不是*.sass。
我还在我的vue.config.js 中注入了一个包含 mixins 和其他变量的全局 SCSS 文件:
css: {
sourceMap: productionSourceMap,
loaderOptions: {
scss: {
prependData: `@import '@/scss/_common.scss';`
}
}
},
我在 common.scss 文件中包含了一个 Vuetify 变量 $border-radius-root,但它似乎没有任何效果。
知道如何在不必编写全新的 CSS 规则来覆盖 Vuetify 生成的样式表的情况下做我想做的事吗?基本上我想改变 Vuetify 使用他们自己的样式表生成器使用的单位。
【问题讨论】:
标签: vue.js sass vuetify.js