index.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. import { unit } from '@ant-design/cssinjs';
  2. import { FastColor } from '@ant-design/fast-color';
  3. import { clearFix, resetComponent, resetIcon } from '../../style';
  4. import { genCollapseMotion, initSlideMotion, initZoomMotion } from '../../style/motion';
  5. import { genStyleHooks, mergeToken } from '../../theme/internal';
  6. import getHorizontalStyle from './horizontal';
  7. import getRTLStyle from './rtl';
  8. import getThemeStyle from './theme';
  9. import getVerticalStyle from './vertical';
  10. const genMenuItemStyle = token => {
  11. const {
  12. componentCls,
  13. motionDurationSlow,
  14. motionDurationMid,
  15. motionEaseInOut,
  16. motionEaseOut,
  17. iconCls,
  18. iconSize,
  19. iconMarginInlineEnd
  20. } = token;
  21. return {
  22. // >>>>> Item
  23. [`${componentCls}-item, ${componentCls}-submenu-title`]: {
  24. position: 'relative',
  25. display: 'block',
  26. margin: 0,
  27. whiteSpace: 'nowrap',
  28. cursor: 'pointer',
  29. transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding calc(${motionDurationSlow} + 0.1s) ${motionEaseInOut}`].join(','),
  30. [`${componentCls}-item-icon, ${iconCls}`]: {
  31. minWidth: iconSize,
  32. fontSize: iconSize,
  33. transition: [`font-size ${motionDurationMid} ${motionEaseOut}`, `margin ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow}`].join(','),
  34. '+ span': {
  35. marginInlineStart: iconMarginInlineEnd,
  36. opacity: 1,
  37. transition: [`opacity ${motionDurationSlow} ${motionEaseInOut}`, `margin ${motionDurationSlow}`, `color ${motionDurationSlow}`].join(',')
  38. }
  39. },
  40. [`${componentCls}-item-icon`]: Object.assign({}, resetIcon()),
  41. [`&${componentCls}-item-only-child`]: {
  42. [`> ${iconCls}, > ${componentCls}-item-icon`]: {
  43. marginInlineEnd: 0
  44. }
  45. }
  46. },
  47. // Disabled state sets text to gray and nukes hover/tab effects
  48. [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: {
  49. background: 'none !important',
  50. cursor: 'not-allowed',
  51. '&::after': {
  52. borderColor: 'transparent !important'
  53. },
  54. a: {
  55. color: 'inherit !important',
  56. cursor: 'not-allowed',
  57. pointerEvents: 'none'
  58. },
  59. [`> ${componentCls}-submenu-title`]: {
  60. color: 'inherit !important',
  61. cursor: 'not-allowed'
  62. }
  63. }
  64. };
  65. };
  66. const genSubMenuArrowStyle = token => {
  67. const {
  68. componentCls,
  69. motionDurationSlow,
  70. motionEaseInOut,
  71. borderRadius,
  72. menuArrowSize,
  73. menuArrowOffset
  74. } = token;
  75. return {
  76. [`${componentCls}-submenu`]: {
  77. '&-expand-icon, &-arrow': {
  78. position: 'absolute',
  79. top: '50%',
  80. insetInlineEnd: token.margin,
  81. width: menuArrowSize,
  82. color: 'currentcolor',
  83. transform: 'translateY(-50%)',
  84. transition: `transform ${motionDurationSlow} ${motionEaseInOut}, opacity ${motionDurationSlow}`
  85. },
  86. '&-arrow': {
  87. // →
  88. '&::before, &::after': {
  89. position: 'absolute',
  90. width: token.calc(menuArrowSize).mul(0.6).equal(),
  91. height: token.calc(menuArrowSize).mul(0.15).equal(),
  92. backgroundColor: 'currentcolor',
  93. borderRadius,
  94. transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `transform ${motionDurationSlow} ${motionEaseInOut}`, `top ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow} ${motionEaseInOut}`].join(','),
  95. content: '""'
  96. },
  97. '&::before': {
  98. transform: `rotate(45deg) translateY(${unit(token.calc(menuArrowOffset).mul(-1).equal())})`
  99. },
  100. '&::after': {
  101. transform: `rotate(-45deg) translateY(${unit(menuArrowOffset)})`
  102. }
  103. }
  104. }
  105. };
  106. };
  107. // =============================== Base ===============================
  108. const getBaseStyle = token => {
  109. const {
  110. antCls,
  111. componentCls,
  112. fontSize,
  113. motionDurationSlow,
  114. motionDurationMid,
  115. motionEaseInOut,
  116. paddingXS,
  117. padding,
  118. colorSplit,
  119. lineWidth,
  120. zIndexPopup,
  121. borderRadiusLG,
  122. subMenuItemBorderRadius,
  123. menuArrowSize,
  124. menuArrowOffset,
  125. lineType,
  126. groupTitleLineHeight,
  127. groupTitleFontSize
  128. } = token;
  129. return [
  130. // Misc
  131. {
  132. '': {
  133. [componentCls]: Object.assign(Object.assign({}, clearFix()), {
  134. // Hidden
  135. '&-hidden': {
  136. display: 'none'
  137. }
  138. })
  139. },
  140. [`${componentCls}-submenu-hidden`]: {
  141. display: 'none'
  142. }
  143. }, {
  144. [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), clearFix()), {
  145. marginBottom: 0,
  146. paddingInlineStart: 0,
  147. // Override default ul/ol
  148. fontSize,
  149. lineHeight: 0,
  150. listStyle: 'none',
  151. outline: 'none',
  152. // Magic cubic here but smooth transition
  153. transition: `width ${motionDurationSlow} cubic-bezier(0.2, 0, 0, 1) 0s`,
  154. 'ul, ol': {
  155. margin: 0,
  156. padding: 0,
  157. listStyle: 'none'
  158. },
  159. // Overflow ellipsis
  160. '&-overflow': {
  161. display: 'flex',
  162. [`${componentCls}-item`]: {
  163. flex: 'none'
  164. }
  165. },
  166. [`${componentCls}-item, ${componentCls}-submenu, ${componentCls}-submenu-title`]: {
  167. borderRadius: token.itemBorderRadius
  168. },
  169. [`${componentCls}-item-group-title`]: {
  170. padding: `${unit(paddingXS)} ${unit(padding)}`,
  171. fontSize: groupTitleFontSize,
  172. lineHeight: groupTitleLineHeight,
  173. transition: `all ${motionDurationSlow}`
  174. },
  175. [`&-horizontal ${componentCls}-submenu`]: {
  176. transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`].join(',')
  177. },
  178. [`${componentCls}-submenu, ${componentCls}-submenu-inline`]: {
  179. transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationMid} ${motionEaseInOut}`].join(',')
  180. },
  181. [`${componentCls}-submenu ${componentCls}-sub`]: {
  182. cursor: 'initial',
  183. transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationSlow} ${motionEaseInOut}`].join(',')
  184. },
  185. [`${componentCls}-title-content`]: {
  186. transition: `color ${motionDurationSlow}`,
  187. '&-with-extra': {
  188. display: 'inline-flex',
  189. alignItems: 'center',
  190. width: '100%'
  191. },
  192. // https://github.com/ant-design/ant-design/issues/41143
  193. [`> ${antCls}-typography-ellipsis-single-line`]: {
  194. display: 'inline',
  195. verticalAlign: 'unset'
  196. },
  197. [`${componentCls}-item-extra`]: {
  198. marginInlineStart: 'auto',
  199. paddingInlineStart: token.padding
  200. }
  201. },
  202. [`${componentCls}-item a`]: {
  203. '&::before': {
  204. position: 'absolute',
  205. inset: 0,
  206. backgroundColor: 'transparent',
  207. content: '""'
  208. }
  209. },
  210. // Removed a Badge related style seems it's safe
  211. // https://github.com/ant-design/ant-design/issues/19809
  212. // >>>>> Divider
  213. [`${componentCls}-item-divider`]: {
  214. overflow: 'hidden',
  215. lineHeight: 0,
  216. borderColor: colorSplit,
  217. borderStyle: lineType,
  218. borderWidth: 0,
  219. borderTopWidth: lineWidth,
  220. marginBlock: lineWidth,
  221. padding: 0,
  222. '&-dashed': {
  223. borderStyle: 'dashed'
  224. }
  225. }
  226. }), genMenuItemStyle(token)), {
  227. [`${componentCls}-item-group`]: {
  228. [`${componentCls}-item-group-list`]: {
  229. margin: 0,
  230. padding: 0,
  231. [`${componentCls}-item, ${componentCls}-submenu-title`]: {
  232. paddingInline: `${unit(token.calc(fontSize).mul(2).equal())} ${unit(padding)}`
  233. }
  234. }
  235. },
  236. // ======================= Sub Menu =======================
  237. '&-submenu': {
  238. '&-popup': {
  239. position: 'absolute',
  240. zIndex: zIndexPopup,
  241. borderRadius: borderRadiusLG,
  242. boxShadow: 'none',
  243. transformOrigin: '0 0',
  244. [`&${componentCls}-submenu`]: {
  245. background: 'transparent'
  246. },
  247. // https://github.com/ant-design/ant-design/issues/13955
  248. '&::before': {
  249. position: 'absolute',
  250. inset: 0,
  251. zIndex: -1,
  252. width: '100%',
  253. height: '100%',
  254. opacity: 0,
  255. content: '""'
  256. },
  257. [`> ${componentCls}`]: Object.assign(Object.assign(Object.assign({
  258. borderRadius: borderRadiusLG
  259. }, genMenuItemStyle(token)), genSubMenuArrowStyle(token)), {
  260. [`${componentCls}-item, ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
  261. borderRadius: subMenuItemBorderRadius
  262. },
  263. [`${componentCls}-submenu-title::after`]: {
  264. transition: `transform ${motionDurationSlow} ${motionEaseInOut}`
  265. }
  266. })
  267. },
  268. [`
  269. &-placement-leftTop,
  270. &-placement-bottomRight,
  271. `]: {
  272. transformOrigin: '100% 0'
  273. },
  274. [`
  275. &-placement-leftBottom,
  276. &-placement-topRight,
  277. `]: {
  278. transformOrigin: '100% 100%'
  279. },
  280. [`
  281. &-placement-rightBottom,
  282. &-placement-topLeft,
  283. `]: {
  284. transformOrigin: '0 100%'
  285. },
  286. [`
  287. &-placement-bottomLeft,
  288. &-placement-rightTop,
  289. `]: {
  290. transformOrigin: '0 0'
  291. },
  292. [`
  293. &-placement-leftTop,
  294. &-placement-leftBottom
  295. `]: {
  296. paddingInlineEnd: token.paddingXS
  297. },
  298. [`
  299. &-placement-rightTop,
  300. &-placement-rightBottom
  301. `]: {
  302. paddingInlineStart: token.paddingXS
  303. },
  304. [`
  305. &-placement-topRight,
  306. &-placement-topLeft
  307. `]: {
  308. paddingBottom: token.paddingXS
  309. },
  310. [`
  311. &-placement-bottomRight,
  312. &-placement-bottomLeft
  313. `]: {
  314. paddingTop: token.paddingXS
  315. }
  316. }
  317. }), genSubMenuArrowStyle(token)), {
  318. [`&-inline-collapsed ${componentCls}-submenu-arrow,
  319. &-inline ${componentCls}-submenu-arrow`]: {
  320. // ↓
  321. '&::before': {
  322. transform: `rotate(-45deg) translateX(${unit(menuArrowOffset)})`
  323. },
  324. '&::after': {
  325. transform: `rotate(45deg) translateX(${unit(token.calc(menuArrowOffset).mul(-1).equal())})`
  326. }
  327. },
  328. [`${componentCls}-submenu-open${componentCls}-submenu-inline > ${componentCls}-submenu-title > ${componentCls}-submenu-arrow`]: {
  329. // ↑
  330. transform: `translateY(${unit(token.calc(menuArrowSize).mul(0.2).mul(-1).equal())})`,
  331. '&::after': {
  332. transform: `rotate(-45deg) translateX(${unit(token.calc(menuArrowOffset).mul(-1).equal())})`
  333. },
  334. '&::before': {
  335. transform: `rotate(45deg) translateX(${unit(menuArrowOffset)})`
  336. }
  337. }
  338. })
  339. },
  340. // Integration with header element so menu items have the same height
  341. {
  342. [`${antCls}-layout-header`]: {
  343. [componentCls]: {
  344. lineHeight: 'inherit'
  345. }
  346. }
  347. }];
  348. };
  349. export const prepareComponentToken = token => {
  350. var _a, _b, _c;
  351. const {
  352. colorPrimary,
  353. colorError,
  354. colorTextDisabled,
  355. colorErrorBg,
  356. colorText,
  357. colorTextDescription,
  358. colorBgContainer,
  359. colorFillAlter,
  360. colorFillContent,
  361. lineWidth,
  362. lineWidthBold,
  363. controlItemBgActive,
  364. colorBgTextHover,
  365. controlHeightLG,
  366. lineHeight,
  367. colorBgElevated,
  368. marginXXS,
  369. padding,
  370. fontSize,
  371. controlHeightSM,
  372. fontSizeLG,
  373. colorTextLightSolid,
  374. colorErrorHover
  375. } = token;
  376. const activeBarWidth = (_a = token.activeBarWidth) !== null && _a !== void 0 ? _a : 0;
  377. const activeBarBorderWidth = (_b = token.activeBarBorderWidth) !== null && _b !== void 0 ? _b : lineWidth;
  378. const itemMarginInline = (_c = token.itemMarginInline) !== null && _c !== void 0 ? _c : token.marginXXS;
  379. const colorTextDark = new FastColor(colorTextLightSolid).setA(0.65).toRgbString();
  380. return {
  381. dropdownWidth: 160,
  382. zIndexPopup: token.zIndexPopupBase + 50,
  383. radiusItem: token.borderRadiusLG,
  384. itemBorderRadius: token.borderRadiusLG,
  385. radiusSubMenuItem: token.borderRadiusSM,
  386. subMenuItemBorderRadius: token.borderRadiusSM,
  387. colorItemText: colorText,
  388. itemColor: colorText,
  389. colorItemTextHover: colorText,
  390. itemHoverColor: colorText,
  391. colorItemTextHoverHorizontal: colorPrimary,
  392. horizontalItemHoverColor: colorPrimary,
  393. colorGroupTitle: colorTextDescription,
  394. groupTitleColor: colorTextDescription,
  395. colorItemTextSelected: colorPrimary,
  396. itemSelectedColor: colorPrimary,
  397. subMenuItemSelectedColor: colorPrimary,
  398. colorItemTextSelectedHorizontal: colorPrimary,
  399. horizontalItemSelectedColor: colorPrimary,
  400. colorItemBg: colorBgContainer,
  401. itemBg: colorBgContainer,
  402. colorItemBgHover: colorBgTextHover,
  403. itemHoverBg: colorBgTextHover,
  404. colorItemBgActive: colorFillContent,
  405. itemActiveBg: controlItemBgActive,
  406. colorSubItemBg: colorFillAlter,
  407. subMenuItemBg: colorFillAlter,
  408. colorItemBgSelected: controlItemBgActive,
  409. itemSelectedBg: controlItemBgActive,
  410. colorItemBgSelectedHorizontal: 'transparent',
  411. horizontalItemSelectedBg: 'transparent',
  412. colorActiveBarWidth: 0,
  413. activeBarWidth,
  414. colorActiveBarHeight: lineWidthBold,
  415. activeBarHeight: lineWidthBold,
  416. colorActiveBarBorderSize: lineWidth,
  417. activeBarBorderWidth,
  418. // Disabled
  419. colorItemTextDisabled: colorTextDisabled,
  420. itemDisabledColor: colorTextDisabled,
  421. // Danger
  422. colorDangerItemText: colorError,
  423. dangerItemColor: colorError,
  424. colorDangerItemTextHover: colorError,
  425. dangerItemHoverColor: colorError,
  426. colorDangerItemTextSelected: colorError,
  427. dangerItemSelectedColor: colorError,
  428. colorDangerItemBgActive: colorErrorBg,
  429. dangerItemActiveBg: colorErrorBg,
  430. colorDangerItemBgSelected: colorErrorBg,
  431. dangerItemSelectedBg: colorErrorBg,
  432. itemMarginInline,
  433. horizontalItemBorderRadius: 0,
  434. horizontalItemHoverBg: 'transparent',
  435. itemHeight: controlHeightLG,
  436. groupTitleLineHeight: lineHeight,
  437. collapsedWidth: controlHeightLG * 2,
  438. popupBg: colorBgElevated,
  439. itemMarginBlock: marginXXS,
  440. itemPaddingInline: padding,
  441. horizontalLineHeight: `${controlHeightLG * 1.15}px`,
  442. iconSize: fontSize,
  443. iconMarginInlineEnd: controlHeightSM - fontSize,
  444. collapsedIconSize: fontSizeLG,
  445. groupTitleFontSize: fontSize,
  446. // Disabled
  447. darkItemDisabledColor: new FastColor(colorTextLightSolid).setA(0.25).toRgbString(),
  448. // Dark
  449. darkItemColor: colorTextDark,
  450. darkDangerItemColor: colorError,
  451. darkItemBg: '#001529',
  452. darkPopupBg: '#001529',
  453. darkSubMenuItemBg: '#000c17',
  454. darkItemSelectedColor: colorTextLightSolid,
  455. darkItemSelectedBg: colorPrimary,
  456. darkDangerItemSelectedBg: colorError,
  457. darkItemHoverBg: 'transparent',
  458. darkGroupTitleColor: colorTextDark,
  459. darkItemHoverColor: colorTextLightSolid,
  460. darkDangerItemHoverColor: colorErrorHover,
  461. darkDangerItemSelectedColor: colorTextLightSolid,
  462. darkDangerItemActiveBg: colorError,
  463. // internal
  464. itemWidth: activeBarWidth ? `calc(100% + ${activeBarBorderWidth}px)` : `calc(100% - ${itemMarginInline * 2}px)`
  465. };
  466. };
  467. // ============================== Export ==============================
  468. export default (prefixCls, rootCls = prefixCls, injectStyle = true) => {
  469. const useStyle = genStyleHooks('Menu', token => {
  470. const {
  471. colorBgElevated,
  472. controlHeightLG,
  473. fontSize,
  474. darkItemColor,
  475. darkDangerItemColor,
  476. darkItemBg,
  477. darkSubMenuItemBg,
  478. darkItemSelectedColor,
  479. darkItemSelectedBg,
  480. darkDangerItemSelectedBg,
  481. darkItemHoverBg,
  482. darkGroupTitleColor,
  483. darkItemHoverColor,
  484. darkItemDisabledColor,
  485. darkDangerItemHoverColor,
  486. darkDangerItemSelectedColor,
  487. darkDangerItemActiveBg,
  488. popupBg,
  489. darkPopupBg
  490. } = token;
  491. const menuArrowSize = token.calc(fontSize).div(7).mul(5).equal();
  492. // Menu Token
  493. const menuToken = mergeToken(token, {
  494. menuArrowSize,
  495. menuHorizontalHeight: token.calc(controlHeightLG).mul(1.15).equal(),
  496. menuArrowOffset: token.calc(menuArrowSize).mul(0.25).equal(),
  497. menuSubMenuBg: colorBgElevated,
  498. calc: token.calc,
  499. popupBg
  500. });
  501. const menuDarkToken = mergeToken(menuToken, {
  502. itemColor: darkItemColor,
  503. itemHoverColor: darkItemHoverColor,
  504. groupTitleColor: darkGroupTitleColor,
  505. itemSelectedColor: darkItemSelectedColor,
  506. subMenuItemSelectedColor: darkItemSelectedColor,
  507. itemBg: darkItemBg,
  508. popupBg: darkPopupBg,
  509. subMenuItemBg: darkSubMenuItemBg,
  510. itemActiveBg: 'transparent',
  511. itemSelectedBg: darkItemSelectedBg,
  512. activeBarHeight: 0,
  513. activeBarBorderWidth: 0,
  514. itemHoverBg: darkItemHoverBg,
  515. // Disabled
  516. itemDisabledColor: darkItemDisabledColor,
  517. // Danger
  518. dangerItemColor: darkDangerItemColor,
  519. dangerItemHoverColor: darkDangerItemHoverColor,
  520. dangerItemSelectedColor: darkDangerItemSelectedColor,
  521. dangerItemActiveBg: darkDangerItemActiveBg,
  522. dangerItemSelectedBg: darkDangerItemSelectedBg,
  523. menuSubMenuBg: darkSubMenuItemBg,
  524. // Horizontal
  525. horizontalItemSelectedColor: darkItemSelectedColor,
  526. horizontalItemSelectedBg: darkItemSelectedBg
  527. });
  528. return [
  529. // Basic
  530. getBaseStyle(menuToken),
  531. // Horizontal
  532. getHorizontalStyle(menuToken),
  533. // Hard code for some light style
  534. // Vertical
  535. getVerticalStyle(menuToken),
  536. // Hard code for some light style
  537. // Theme
  538. getThemeStyle(menuToken, 'light'), getThemeStyle(menuDarkToken, 'dark'),
  539. // RTL
  540. getRTLStyle(menuToken),
  541. // Motion
  542. genCollapseMotion(menuToken), initSlideMotion(menuToken, 'slide-up'), initSlideMotion(menuToken, 'slide-down'), initZoomMotion(menuToken, 'zoom-big')];
  543. }, prepareComponentToken, {
  544. deprecatedTokens: [['colorGroupTitle', 'groupTitleColor'], ['radiusItem', 'itemBorderRadius'], ['radiusSubMenuItem', 'subMenuItemBorderRadius'], ['colorItemText', 'itemColor'], ['colorItemTextHover', 'itemHoverColor'], ['colorItemTextHoverHorizontal', 'horizontalItemHoverColor'], ['colorItemTextSelected', 'itemSelectedColor'], ['colorItemTextSelectedHorizontal', 'horizontalItemSelectedColor'], ['colorItemTextDisabled', 'itemDisabledColor'], ['colorDangerItemText', 'dangerItemColor'], ['colorDangerItemTextHover', 'dangerItemHoverColor'], ['colorDangerItemTextSelected', 'dangerItemSelectedColor'], ['colorDangerItemBgActive', 'dangerItemActiveBg'], ['colorDangerItemBgSelected', 'dangerItemSelectedBg'], ['colorItemBg', 'itemBg'], ['colorItemBgHover', 'itemHoverBg'], ['colorSubItemBg', 'subMenuItemBg'], ['colorItemBgActive', 'itemActiveBg'], ['colorItemBgSelectedHorizontal', 'horizontalItemSelectedBg'], ['colorActiveBarWidth', 'activeBarWidth'], ['colorActiveBarHeight', 'activeBarHeight'], ['colorActiveBarBorderSize', 'activeBarBorderWidth'], ['colorItemBgSelected', 'itemSelectedBg']],
  545. // Dropdown will handle menu style self. We do not need to handle this.
  546. injectStyle,
  547. unitless: {
  548. groupTitleLineHeight: true
  549. }
  550. });
  551. return useStyle(prefixCls, rootCls);
  552. };