feat: Menu add token subMenuItemSelectedColor (#52182)
Some checks are pending
Publish Any Commit / build (push) Waiting to run
🔀 Sync mirror to Gitee / mirror (push) Waiting to run
✅ test / lint (push) Waiting to run
✅ test / test-react-legacy (16, 1/2) (push) Waiting to run
✅ test / test-react-legacy (16, 2/2) (push) Waiting to run
✅ test / test-react-legacy (17, 1/2) (push) Waiting to run
✅ test / test-react-legacy (17, 2/2) (push) Waiting to run
✅ test / test-node (push) Waiting to run
✅ test / test-react-latest (dom, 1/2) (push) Waiting to run
✅ test / test-react-latest (dom, 2/2) (push) Waiting to run
✅ test / test-react-latest-dist (dist, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist, 2/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Blocked by required conditions
✅ test / test-coverage (push) Blocked by required conditions
✅ test / build (push) Waiting to run
✅ test / test lib/es module (es, 1/2) (push) Waiting to run
✅ test / test lib/es module (es, 2/2) (push) Waiting to run
✅ test / test lib/es module (lib, 1/2) (push) Waiting to run
✅ test / test lib/es module (lib, 2/2) (push) Waiting to run
👁️ Visual Regression Persist Start / test image (push) Waiting to run

- close https://github.com/ant-design/ant-design/issues/45488
- close https://github.com/ant-design/ant-design/issues/46354
- close https://github.com/ant-design/ant-design/issues/52166
This commit is contained in:
afc163 2024-12-31 15:38:28 +08:00 committed by GitHub
parent 650d2dab60
commit ab3b6ab6e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -95,6 +95,11 @@ export interface ComponentToken {
* @descEN Color of selected menu item text
*/
itemSelectedColor: string;
/**
* @desc
* @descEN Color of submenu title when submenu has selected item
*/
subMenuItemSelectedColor: string;
/** @deprecated Use `horizontalItemSelectedColor` instead */
colorItemTextSelectedHorizontal: string;
@ -890,6 +895,7 @@ export const prepareComponentToken: GetDefaultToken<'Menu'> = (token) => {
groupTitleColor: colorTextDescription,
colorItemTextSelected: colorPrimary,
itemSelectedColor: colorPrimary,
subMenuItemSelectedColor: colorPrimary,
colorItemTextSelectedHorizontal: colorPrimary,
horizontalItemSelectedColor: colorPrimary,
colorItemBg: colorBgContainer,

View File

@ -13,6 +13,7 @@ const getThemeStyle = (token: MenuToken, themeSuffix: string): CSSInterpolation
componentCls,
itemColor,
itemSelectedColor,
subMenuItemSelectedColor,
groupTitleColor,
itemBg,
subMenuItemBg,
@ -67,10 +68,8 @@ const getThemeStyle = (token: MenuToken, themeSuffix: string): CSSInterpolation
},
},
[`${componentCls}-submenu-selected`]: {
[`> ${componentCls}-submenu-title`]: {
color: itemSelectedColor,
},
[`${componentCls}-submenu-selected > ${componentCls}-submenu-title`]: {
color: subMenuItemSelectedColor,
},
[`${componentCls}-item, ${componentCls}-submenu-title`]: {