返回 AiToEarn
main.tsx
1 import React from 'react';
2 import ReactDOM from 'react-dom/client';
3 import App from './App';
4 import { ConfigProvider } from 'antd';
5 import zh_CN from 'antd/es/locale/zh_CN';
6 import 'virtual:svg-icons-register';
7
8 import './index.scss';
9 import './var.css';
10
11 import { generate } from '@ant-design/colors';
12
13 ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
14 <>
15 {(() => {
16 const colors = generate('#a66ae4');
17 const root = document.documentElement;
18 for (let i = 0; i < colors.length; i++) {
19 /**
20 * 主题色:
21 * --colorPrimary1 ~~ --colorPrimary10
22 * 由浅到深
23 * 注意:“--colorPrimary6” 为中间主题色,不是 “5”
24 */
25 root.style.setProperty(`--colorPrimary${i + 1}`, colors[i]);
26 }
27
28 return (
29 <ConfigProvider
30 locale={zh_CN}
31 theme={{
32 token: {
33 colorPrimary: colors[5].trim(),
34 },
35 }}
36 >
37 <App />
38 </ConfigProvider>
39 );
40 })()}
41 </>,
42 );
43
44 postMessage({ payload: 'removeLoading' }, '*');
45
45 lines Plain Text