feat: Tabs support token (#44201)

pull/44211/head
MadCcc 1 year ago committed by GitHub
parent 0a4463e68a
commit 6de03aef37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,6 +22,7 @@ const App: React.FC = () => (
horizontalItemPaddingLG: `20px`, horizontalItemPaddingLG: `20px`,
verticalItemPadding: `8px`, verticalItemPadding: `8px`,
verticalItemMargin: `4px 0 0 0`, verticalItemMargin: `4px 0 0 0`,
itemColor: 'rgba(0,0,0,0.85)',
itemSelectedColor: '#389e0d', itemSelectedColor: '#389e0d',
itemHoverColor: '#d9f7be', itemHoverColor: '#d9f7be',
itemActiveColor: '#b7eb8f', itemActiveColor: '#b7eb8f',

@ -100,6 +100,11 @@ export interface ComponentToken {
* @descEN Vertical margin of vertical tab item * @descEN Vertical margin of vertical tab item
*/ */
verticalItemMargin: string; verticalItemMargin: string;
/**
* @desc
* @descEN Text color of tab
*/
itemColor: string;
/** /**
* @desc * @desc
* @descEN Text color of active tab * @descEN Text color of active tab
@ -656,6 +661,7 @@ const genTabStyle: GenerateStyle<TabsToken, CSSObject> = (token: TabsToken) => {
tabsHorizontalItemMargin, tabsHorizontalItemMargin,
horizontalItemPadding, horizontalItemPadding,
itemSelectedColor, itemSelectedColor,
itemColor,
} = token; } = token;
const tabCls = `${componentCls}-tab`; const tabCls = `${componentCls}-tab`;
@ -673,6 +679,7 @@ const genTabStyle: GenerateStyle<TabsToken, CSSObject> = (token: TabsToken) => {
border: 0, border: 0,
outline: 'none', outline: 'none',
cursor: 'pointer', cursor: 'pointer',
color: itemColor,
'&-btn, &-remove': { '&-btn, &-remove': {
'&:focus:not(:focus-visible), &:active': { '&:focus:not(:focus-visible), &:active': {
color: itemActiveColor, color: itemActiveColor,
@ -1052,6 +1059,7 @@ export default genComponentStyleHook(
horizontalItemPaddingLG: `${token.padding}px 0`, horizontalItemPaddingLG: `${token.padding}px 0`,
verticalItemPadding: `${token.paddingXS}px ${token.paddingLG}px`, verticalItemPadding: `${token.paddingXS}px ${token.paddingLG}px`,
verticalItemMargin: `${token.margin}px 0 0 0`, verticalItemMargin: `${token.margin}px 0 0 0`,
itemColor: token.colorText,
itemSelectedColor: token.colorPrimary, itemSelectedColor: token.colorPrimary,
itemHoverColor: token.colorPrimaryHover, itemHoverColor: token.colorPrimaryHover,
itemActiveColor: token.colorPrimaryActive, itemActiveColor: token.colorPrimaryActive,

Loading…
Cancel
Save