feat(theme): 添加主题配置文件并集成到应用中
This commit is contained in:
@@ -12,6 +12,7 @@ import { useAppSelector } from './hooks';
|
||||
import * as langs from './langs';
|
||||
import globalMessage from './message';
|
||||
import { store } from './store';
|
||||
import appTheme from './theme';
|
||||
|
||||
const { darkAlgorithm } = theme;
|
||||
|
||||
@@ -34,13 +35,14 @@ const AppInternal: React.FC<{ router: Router }> = (props) => {
|
||||
|
||||
const themeConfig = useMemo(() => {
|
||||
return {
|
||||
algorithm: theme === Theme.DARK ? [darkAlgorithm] : [],
|
||||
cssVar: true,
|
||||
algorithm: (theme === Theme.DARK ? [darkAlgorithm] : []).concat(appTheme.algorithm ?? []),
|
||||
cssVar: appTheme.cssVar ?? true,
|
||||
token: primaryColor
|
||||
? {
|
||||
colorPrimary: primaryColor,
|
||||
}
|
||||
: undefined,
|
||||
colorPrimary: primaryColor,
|
||||
...appTheme.token,
|
||||
}
|
||||
: appTheme.token,
|
||||
};
|
||||
}, [primaryColor, theme]);
|
||||
|
||||
|
||||
7
src/app/theme.ts
Normal file
7
src/app/theme.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ThemeConfig, theme } from '@toco-design/components';
|
||||
|
||||
const appTheme: ThemeConfig = {
|
||||
|
||||
};
|
||||
|
||||
export default appTheme;
|
||||
Reference in New Issue
Block a user