mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-29 18:50:00 +08:00
chore: rename theme separated to inherit
This commit is contained in:
parent
c0de3b2737
commit
a77f1aa8fc
@ -186,7 +186,7 @@ describe('ConfigProvider.Theme', () => {
|
||||
};
|
||||
render(
|
||||
<ConfigProvider theme={{ token: { colorPrimary: '#1890ff' } }}>
|
||||
<ConfigProvider theme={{ seperated: true }}>
|
||||
<ConfigProvider theme={{ inherit: false }}>
|
||||
<Demo />
|
||||
</ConfigProvider>
|
||||
</ConfigProvider>,
|
||||
|
@ -30,7 +30,7 @@ export interface ThemeConfig {
|
||||
components?: OverrideToken;
|
||||
algorithm?: MappingAlgorithm | MappingAlgorithm[];
|
||||
hashed?: boolean;
|
||||
seperated?: boolean;
|
||||
inherit?: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigConsumerProps {
|
||||
|
@ -10,7 +10,7 @@ export default function useTheme(
|
||||
): ThemeConfig | undefined {
|
||||
const themeConfig = theme || {};
|
||||
const parentThemeConfig: ThemeConfig =
|
||||
themeConfig.seperated || !parentTheme ? defaultConfig : parentTheme;
|
||||
themeConfig.inherit === false || !parentTheme ? defaultConfig : parentTheme;
|
||||
|
||||
const mergedTheme = useMemo<ThemeConfig | undefined>(
|
||||
() => {
|
||||
|
@ -195,7 +195,7 @@ const theme = {
|
||||
| 属性 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| token | Modify Design Token | `AliasToken` | - |
|
||||
| seperated | Ignore theme configured in upper ConfigProvider | boolean | - |
|
||||
| inherit | Inherit theme configured in upper ConfigProvider | boolean | true |
|
||||
| algorithm | Modify the algorithms of theme | `(token: SeedToken) => MapToken` \| `((token: SeedToken) => MapToken)[]` | `defaultAlgorithm` |
|
||||
| components | Modify Component Token and Alias Token applied to components | OverrideToken | - |
|
||||
|
||||
|
@ -195,7 +195,7 @@ const theme = {
|
||||
| 属性 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| token | 用于修改 Design Token | `AliasToken` | - |
|
||||
| seperated | 隔离上层 ConfigProvider 中配置的主题。 | boolean | - |
|
||||
| inherit | 继承上层 ConfigProvider 中配置的主题。 | boolean | true |
|
||||
| algorithm | 用于修改 Seed Token 到 Map Token 的算法 | `(token: SeedToken) => MapToken` \| `((token: SeedToken) => MapToken)[]` | `defaultAlgorithm` |
|
||||
| components | 用于修改各个组件的 Component Token 以及覆盖该组件消费的 Alias Token | OverrideToken | - |
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user