From 7997a2f98b9182bbc490acb2ded09af94037c7db Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Mon, 15 Apr 2024 10:00:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/app.tsx | 23 +++++++++++++++++++++++ react-ui/src/styles/theme.less | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/react-ui/src/app.tsx b/react-ui/src/app.tsx index ee86b5cd..5c255b73 100644 --- a/react-ui/src/app.tsx +++ b/react-ui/src/app.tsx @@ -1,7 +1,9 @@ import RightContent from '@/components/RightContent'; +import themes from '@/styles/theme.less'; import type { Settings as LayoutSettings } from '@ant-design/pro-components'; import type { RunTimeLayoutConfig } from '@umijs/max'; import { history } from '@umijs/max'; +import { RuntimeAntdConfig } from 'umi'; import defaultSettings from '../config/defaultSettings'; import '../public/fonts/font.css'; import { getAccessToken } from './access'; @@ -182,3 +184,24 @@ export function render(oldRender: () => void) { oldRender(); }); } + +// 主题修改 +export const antd: RuntimeAntdConfig = (memo) => { + memo.theme ??= {}; + memo.theme.token = { + colorPrimary: themes['primaryColor'], + }; + memo.theme.components ??= {}; + memo.theme.components.Tabs = {}; + // memo.theme.cssVar = true; + // memo.theme.hashed = false; + + // memo.appConfig = { + // message: { + // // 配置 message 最大显示数,超过限制时,最早的消息会被自动关闭 + // maxCount: 3, + // }, + // }; + + return memo; +}; diff --git a/react-ui/src/styles/theme.less b/react-ui/src/styles/theme.less index f9385817..8f33148d 100644 --- a/react-ui/src/styles/theme.less +++ b/react-ui/src/styles/theme.less @@ -1,6 +1,12 @@ // 全局颜色变量 // FIXME: 不能设置 @primary-color 不起作用,感觉是哪里被重置了 @kf-primary-color: #1664ff; // 主色调 +@text-color: #1d1d20; +@font-size: 15px; +@border-color: rgba(22, 100, 255, 0.3); +@border-color-second: rgba(22, 100, 255, 0.1); +@background-color-primay: rgba(22, 100, 255, 0.03); +@background-color-gray: rgba(4, 3, 3, 0.06); // 导出变量 :export {