arco design pro (vue) 修改组件的颜色无效怎么办 #1806
Answered
by
hehehai
Time1sMoney
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
hehehai
Oct 30, 2022
Replies: 1 comment 3 replies
-
@coderlcb hi, 可以参考该 问题 参考:https://stackblitz.com/edit/vitejs-vite-qy4cey?file=vite.config.ts (使用了 vite3) import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { ArcoResolver } from 'unplugin-vue-components/resolvers';
// https://vitejs.dev/config/
export default defineConfig({
css: {
preprocessorOptions: {
less: {
modifyVars: { 'color-primary-6': '#13c2c2' },
},
},
},
plugins: [
vue(),
Components({
resolvers: [
ArcoResolver({
importStyle: 'less',
}),
],
}),
],
}); less 变量可以使用 css 变量来调整(明暗模式影响的是 css 变量) css: {
preprocessorOptions: {
less: {
modifyVars: {
'primary-6': `rgb(var(~'@{arco-cssvars-prefix}-green-6'))`,
'dark-primary-6': `rgb(var(~'@{arco-cssvars-prefix}-orange-6'))`,
},
},
},
}, 这里主题自定义建议使用官方的主题设计系统来配置 |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
hehehai
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@coderlcb hi, 可以参考该 问题
参考:https://stackblitz.com/edit/vitejs-vite-qy4cey?file=vite.config.ts (使用了 vite3)
less 变量可以使用 css 变量来调整(明暗模式影响的是 css 变量)