Skip to content

arco design pro (vue) 修改组件的颜色无效怎么办 #1806

Answered by hehehai
chenbinli-dev asked this question in Q&A
Discussion options

You must be logged in to vote

@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: {
    preproc…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@chenbinli-dev
Comment options

@hehehai
Comment options

@chenbinli-dev
Comment options

Answer selected by hehehai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants