create-iking-admin
Version:
金合技术中台脚手架
49 lines (44 loc) • 1.63 kB
text/typescript
/*
* @Author: wfl
* @LastEditors: wfl
* @description:
* @updateInfo:
* @Date: 2022-08-12 18:42:51
* @LastEditTime: 2022-10-24 10:30:15
*/
import { getThemeVariables } from 'ant-design-vue/dist/theme';
import { resolve } from 'path';
import { generateAntColors, primaryColor } from '../config/themeConfig';
/**
* less global variable
*/
export function generateModifyVars(dark = false) {
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 modifyVars = getThemeVariables({ dark });
return {
...modifyVars,
// Used for global import to avoid the need to import each style file separately
// reference: Avoid repeated references
hack: `${modifyVars.hack} @import (reference) "${resolve('src/mainApp/design/config.less')}";`,
'primary-color': primary,
...primaryColorObj,
'info-color': primary,
'processing-color': primary,
'success-color': '#55D187', // Success color
'error-color': '#ED6F6F', // False color
'warning-color': '#EFBD47', // Warning color
//'border-color-base': '#EEEEEE',
'font-size-base': '14px', // Main font size
'border-radius-base': '2px', // Component/float fillet
'link-color': primary, // Link color
'app-content-background': '#fafafa', // Link color
'height-base': '36px', // base height
'height-lg': '44px', // large height
'height-sm': '28px',
};
}