diff --git a/components/button/demo/component-token.tsx b/components/button/demo/component-token.tsx index a7140816ee..91c6153f96 100644 --- a/components/button/demo/component-token.tsx +++ b/components/button/demo/component-token.tsx @@ -1,8 +1,222 @@ import React from 'react'; +import { SearchOutlined } from '@ant-design/icons'; import { Button, ConfigProvider, Flex } from 'antd'; const App: React.FC = () => ( +
Component Token
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Global Token
(
- - - - - - - - - - - - - - - - - ); diff --git a/components/button/style/token.ts b/components/button/style/token.ts index 330604a158..dedb914ee9 100644 --- a/components/button/style/token.ts +++ b/components/button/style/token.ts @@ -154,16 +154,19 @@ export interface ComponentToken { /** * @desc 按钮纵向内间距 * @descEN Vertical padding of button + * @deprecated not used */ paddingBlock: CSSProperties['paddingBlock']; /** * @desc 大号按钮纵向内间距 * @descEN Vertical padding of large button + * @deprecated not used */ paddingBlockLG: CSSProperties['paddingBlock']; /** * @desc 小号按钮纵向内间距 * @descEN Vertical padding of small button + * @deprecated not used */ paddingBlockSM: CSSProperties['paddingBlock']; /** @@ -209,16 +212,19 @@ export interface ComponentToken { /** * @desc 按钮内容字体行高 * @descEN Line height of button content + * @deprecated not used */ contentLineHeight: number; /** * @desc 大号按钮内容字体行高 * @descEN Line height of large button content + * @deprecated not used */ contentLineHeightLG: number; /** * @desc 小号按钮内容字体行高 * @descEN Line height of small button content + * @deprecated not used */ contentLineHeightSM: number; /** diff --git a/components/button/style/variant.ts b/components/button/style/variant.ts index 34c9aba57e..ecfc8c9225 100644 --- a/components/button/style/variant.ts +++ b/components/button/style/variant.ts @@ -165,6 +165,7 @@ const genVariantStyle: GenerateStyle = (token) => { [varName('color-base')]: token.colorLink, [varName('color-hover')]: token.colorLinkHover, [varName('color-active')]: token.colorLinkActive, + [varName('bg-color-hover')]: token.linkHoverBg, }, // ======================== Compatible ======================== @@ -223,6 +224,10 @@ const genVariantStyle: GenerateStyle = (token) => { [varName('text-color-active')]: token.defaultActiveColor, [varName('shadow')]: token.defaultShadow, + [`&${componentCls}-variant-outlined`]: { + [varName('bg-color-disabled')]: token.defaultBgDisabled, + }, + [`&${componentCls}-variant-solid`]: { [varName('text-color')]: token.solidTextColor, [varName('text-color-hover')]: varRef('text-color'), @@ -239,7 +244,7 @@ const genVariantStyle: GenerateStyle = (token) => { [varName('text-color-hover')]: token.defaultHoverColor, [varName('text-color-active')]: token.defaultActiveColor, [varName('bg-color-container')]: token.defaultBg, - [varName('bg-color-hover')]: token.defaultHoverBg, + [varName('bg-color-hover')]: token.defaultHoverBg, [varName('bg-color-active')]: token.defaultActiveBg, }, @@ -303,8 +308,15 @@ const genVariantStyle: GenerateStyle = (token) => { { // Ghost [`&${componentCls}-background-ghost`]: { - [varName('bg-color')]: 'transparent', + [varName('bg-color')]: token.ghostBg, + [varName('bg-color-hover')]: token.ghostBg, + [varName('bg-color-active')]: token.ghostBg, [varName('shadow')]: 'none', + + [`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: { + [varName('bg-color-hover')]: token.ghostBg, + [varName('bg-color-active')]: token.ghostBg, + }, }, }, ],