diff --git a/components/theme/__tests__/token.test.tsx b/components/theme/__tests__/token.test.tsx index b42bb5b676..f2d86fcdbe 100644 --- a/components/theme/__tests__/token.test.tsx +++ b/components/theme/__tests__/token.test.tsx @@ -289,6 +289,8 @@ describe('Theme', () => { expect(token2.colorLink).toEqual(token2.colorInfo); expect(token2.colorLinkHover).toEqual(token2.colorInfoHover); expect(token2.colorLinkActive).toEqual(token2.colorInfoActive); + // colorInfo should not follow colorPrimary + expect(token2.colorLink).not.toEqual('#189cff'); const token3 = getHookToken({ algorithm: [theme.darkAlgorithm] }); expect(token3.colorLink).toEqual(token3.colorInfo); diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md index 2750ff0294..e8525d5da2 100644 --- a/docs/react/faq.en-US.md +++ b/docs/react/faq.en-US.md @@ -211,6 +211,10 @@ Please ref document [Shadow Dom Usage](/docs/react/customize-theme#shadow-dom-us Please ref dynamic theme document [SSR](/docs/react/customize-theme#server-side-render-ssr) part. +## What is the relationship between colorPrimary and colorInfo and colorLink in V5? + +In the Ant Design Token system, `colorPrimary` and `colorInfo` are both [Seed Token](../react/customize-theme.en-US.md#seed-token), so they are independent of each other. `colorLink` is an [Alias Token](../react/customize-theme.en-US.md#alias-token), inherits `colorInfo` by default, and is independent of `colorPrimary`. + ## How to spell Ant Design correctly? - ✅ **Ant Design**: Capitalized with space, for the design language. diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md index 44ba1c143d..18b2f41577 100644 --- a/docs/react/faq.zh-CN.md +++ b/docs/react/faq.zh-CN.md @@ -239,6 +239,10 @@ import { ConfigProvider } from 'antd'; 请参考动态主题文档 [服务端渲染](/docs/react/customize-theme-cn#服务端渲染) 部分内容。 +## V5 中 colorPrimary 和 colorInfo 及 colorLink 之间是什么关系? + +在 Ant Design Token 系统中 `colorPrimary` 和 `colorInfo` 同属于 [基础变量(Seed Token)](../react/customize-theme.zh-CN.md#基础变量seed-token),所以两者是互相独立的。`colorLink` 则属于 [别名变量(Alias Token)](../react/customize-theme.zh-CN.md#别名变量alias-token), 默认继承 `colorInfo` 且和 `colorPrimary` 无关。 + ## 如何正确的拼写 Ant Design? - ✅ **Ant Design**:用空格分隔的首字母大写单词,指代设计语言。