admin-vben/build/generate/generateModifyVars.ts

19 lines
488 B
TypeScript
Raw Normal View History

2023-07-29 10:46:43 +00:00
import { resolve } from 'node:path'
import { generateAntColors, primaryColor } from '../config/themeConfig'
2023-03-18 13:10:54 +00:00
/**
* less global variable
*/
2023-07-30 02:06:13 +00:00
export function generateModifyVars() {
2023-03-18 13:10:54 +00:00
const palettes = generateAntColors(primaryColor)
const primaryColorObj: Record<string, string> = {}
2023-07-29 10:46:43 +00:00
for (let index = 0; index < 10; index++)
2023-03-18 13:10:54 +00:00
primaryColorObj[`primary-${index + 1}`] = palettes[index]
return {
2023-07-30 02:06:13 +00:00
hack: `true; @import (reference) "${resolve('src/design/config.less')}";`,
2023-03-18 13:10:54 +00:00
}
}