12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import { primaryColor } from '../config/themeConfig';
- import { resolve } from 'path';
- import { generate } from '@ant-design/colors';
- import { theme } from 'ant-design-vue/lib';
- import convertLegacyToken from 'ant-design-vue/lib/theme/convertLegacyToken';
- const { defaultAlgorithm, defaultSeed } = theme;
- function generateAntColors(color: string, theme: 'default' | 'dark' = 'default') {
- return generate(color, {
- theme,
- });
- }
- export function generateModifyVars() {
- const palettes = generateAntColors(primaryColor);
- const primary = palettes[5];
- const primaryColorObj: Record<string, string> = {};
- for (let index = 0; index < 10; index++) {
- primaryColorObj[`primary-${index + 1}`] = palettes[index];
- }
- const mapToken = defaultAlgorithm(defaultSeed);
- const v3Token = convertLegacyToken(mapToken);
- return {
- ...v3Token,
-
-
-
- hack: `true; @import (reference) "${resolve('src/design/config.less')}";`,
- 'primary-color': primary,
- ...primaryColorObj,
- 'info-color': primary,
- 'processing-color': primary,
- 'success-color': '#55D187',
- 'error-color': '#ED6F6F',
- 'warning-color': '#EFBD47',
-
- 'font-size-base': '14px',
- 'border-radius-base': '2px',
- 'link-color': primary,
- 'app-content-background': '#fafafa',
- };
- }
|