generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
35 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ group: | |
order: 1 | ||
demo: | ||
cols: 2 | ||
tocDepth: 4 | ||
--- | ||
|
||
## 简介 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
/** | ||
* compact: true | ||
* defaultShowCode: true | ||
* codePlacement: left | ||
*/ | ||
import { Divider } from 'antd'; | ||
import { ThemeProvider } from 'antd-style'; | ||
import { Container } from './style'; | ||
import { ThemeProvider, useTheme } from 'antd-style'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
import App from './_app'; | ||
|
||
export default () => ( | ||
<Container align={'center'} split={<Divider type={'vertical'} />} size={24}> | ||
<ThemeProvider> | ||
<App title={'antd Token'} tokenName={'colorPrimary'} /> | ||
</ThemeProvider> | ||
<ThemeProvider customToken={{ customBrandColor: '#c956df' }}> | ||
<App title={'自定义 Token'} tokenName={'customBrandColor'} /> | ||
</ThemeProvider> | ||
<App title={'未包裹 ThemeProvider 时使用自定义 Token 无效'} tokenName={'customBrandColor'} /> | ||
</Container> | ||
); | ||
export default () => { | ||
const theme = useTheme(); | ||
return ( | ||
<Flexbox padding={24} gap={24} style={{ background: theme.colorBgLayout }}> | ||
<ThemeProvider> | ||
<App title={'antd Token'} tokenName={'colorPrimary'} /> | ||
</ThemeProvider> | ||
<ThemeProvider customToken={{ customBrandColor: '#c956df' }}> | ||
<App title={'自定义 Token'} tokenName={'customBrandColor'} /> | ||
</ThemeProvider> | ||
<App title={'未包裹 ThemeProvider 时使用自定义 Token 无效'} tokenName={'customBrandColor'} /> | ||
</Flexbox> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
title: 主题切换 | ||
group: 快速上手 | ||
order: 2 | ||
demo: | ||
tocDepth: 4 | ||
--- | ||
|
||
# 主题切换 | ||
|