docs: update api description (#55576)

* docs: update api description

* update

* update
This commit is contained in:
lijianan
2025-11-03 12:06:24 +08:00
committed by GitHub
parent 9762df5ae8
commit cad56756e2
4 changed files with 50 additions and 25 deletions

View File

@@ -145,10 +145,21 @@ export interface ThemeConfig {
key?: string;
};
/**
* @descCN 是否关闭运行时样式生成
* @descEN Disable runtime style generation.
* @default false
* @descCN 开启零运行时模式,不会在运行时产生样式,需要手动引入 CSS 文件。
* @descEN Enable zero-runtime mode, which will not generate style at runtime, need to import additional CSS file.
* @default true
* @since 6.0.0
* @example
* ```tsx
* import { ConfigProvider } from 'antd';
* import 'antd/dist/antd.css';
*
* const Demo = () => (
* <ConfigProvider theme={{ zeroRuntime: true }}>
* <App />
* </ConfigProvider>
*);
* ```
*/
zeroRuntime?: boolean;
}

View File

@@ -27,10 +27,24 @@ export interface DesignTokenProviderProps {
/** Just merge `token` & `override` at top to save perf */
override: { override: Partial<AliasToken> } & ComponentsToken;
hashed?: string | boolean;
cssVar?: {
prefix?: string;
key?: string;
};
cssVar?: { prefix?: string; key?: string };
/**
* @descCN 开启零运行时模式,不会在运行时产生样式,需要手动引入 CSS 文件。
* @descEN Enable zero-runtime mode, which will not generate style at runtime, need to import additional CSS file.
* @default true
* @since 6.0.0
* @example
* ```tsx
* import { ConfigProvider } from 'antd';
* import 'antd/dist/antd.css';
*
* const Demo = () => (
* <ConfigProvider theme={{ zeroRuntime: true }}>
* <App />
* </ConfigProvider>
*);
* ```
*/
zeroRuntime?: boolean;
}

View File

@@ -434,15 +434,15 @@ const theme = {
### Theme
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| token | Modify Design Token | `AliasToken` | - |
| 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 | `ComponentsConfig` | - |
| cssVar | CSS Variables Configuration, refer [CSS Variables](/docs/react/css-variables#api) | `boolean \| { prefix?: string; key?: string }` | false |
| hashed | Component class Hash value, refer [CSS Variables](/docs/react/css-variables#disable-hash) | boolean | true |
| zeroRuntime | Enable zero-runtime mode, which will not generate style at runtime | boolean | true |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| token | Modify Design Token | `AliasToken` | - | |
| 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 | `ComponentsConfig` | - | |
| cssVar | CSS Variables Configuration, refer [CSS Variables](/docs/react/css-variables#api) | `boolean \| { prefix?: string; key?: string }` | false | |
| hashed | Component class Hash value, refer [CSS Variables](/docs/react/css-variables#disable-hash) | boolean | true | |
| zeroRuntime | Enable zero-runtime mode, which will not generate style at runtime, need to import additional CSS file | boolean | true | 6.0.0 |
### ComponentsConfig

View File

@@ -434,15 +434,15 @@ const theme = {
### Theme
| 属性 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| token | 用于修改 Design Token | `AliasToken` | - |
| inherit | 继承上层 ConfigProvider 中配置的主题。 | boolean | true |
| algorithm | 用于修改 Seed Token 到 Map Token 的算法 | `(token: SeedToken) => MapToken` \| `((token: SeedToken) => MapToken)[]` | `defaultAlgorithm` |
| components | 用于修改各个组件的 Component Token 以及覆盖该组件消费的 Alias Token | `ComponentsConfig` | - |
| cssVar | CSS 变量配置,参考[使用 CSS 变量](/docs/react/css-variables-cn#api) | `{ prefix?: string; key?: string }` | false |
| hashed | 组件 class Hash 值,参考[使用 CSS 变量](/docs/react/css-variables-cn#关闭-hash) | boolean | true |
| zeroRuntime | 开启零运行时模式,不会在运行时产生样式,需要额外引入 | boolean | true |
| 属性 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| token | 用于修改 Design Token | `AliasToken` | - | |
| inherit | 继承上层 ConfigProvider 中配置的主题。 | boolean | true | |
| algorithm | 用于修改 Seed Token 到 Map Token 的算法 | `(token: SeedToken) => MapToken` \| `((token: SeedToken) => MapToken)[]` | `defaultAlgorithm` | |
| components | 用于修改各个组件的 Component Token 以及覆盖该组件消费的 Alias Token | `ComponentsConfig` | - | |
| cssVar | CSS 变量配置,参考[使用 CSS 变量](/docs/react/css-variables-cn#api) | `{ prefix?: string; key?: string }` | false | |
| hashed | 组件 class Hash 值,参考[使用 CSS 变量](/docs/react/css-variables-cn#关闭-hash) | boolean | true | |
| zeroRuntime | 开启零运行时模式,不会在运行时产生样式,需要手动引入 CSS 文件 | boolean | true | 6.0.0 |
### ComponentsConfig