Skip to content

Commit

Permalink
fix: compatible with legacy token
Browse files Browse the repository at this point in the history
  • Loading branch information
aojunhao123 committed Jan 16, 2025
1 parent 89bff27 commit afcf91a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/button/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const genRoundButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({

const genDisabledStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({
cursor: 'not-allowed',
borderColor: token.colorBorderDisabled,
borderColor: token.colorBorderDisabled ?? token.borderColorDisabled,
color: token.colorTextDisabled,
background: token.colorBgContainerDisabled,
boxShadow: 'none',
Expand Down
6 changes: 6 additions & 0 deletions components/button/style/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export interface ComponentToken {
* @descEN Border color of default button when active
*/
defaultActiveBorderColor: string;
/**
* @deprecated use `colorBorderDisabled` instead
* @desc 禁用状态边框颜色
* @descEN Border color of disabled button
*/
borderColorDisabled: string;
/**
* @desc 默认幽灵按钮文本颜色
* @descEN Text color of default ghost button
Expand Down
9 changes: 8 additions & 1 deletion components/tag/demo/component-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { ConfigProvider, Flex, Tag } from 'antd';

const App: React.FC = () => (
<ConfigProvider
theme={{ components: { Tag: { defaultBg: '#f9f0ff', defaultColor: '#4b34d3' } } }}
theme={{
components: {
Tag: { defaultBg: '#f9f0ff', defaultColor: '#4b34d3', colorBorderDisabled: '#4a4a4a' },
},
}}
>
<Flex gap="small" align="center" wrap>
<Tag>
Expand Down Expand Up @@ -38,6 +42,9 @@ const App: React.FC = () => (
<Tag icon={<SyncOutlined spin />} color="processing">
processing
</Tag>
<Tag color="success" disabled>
disabled
</Tag>
</Flex>
</ConfigProvider>
);
Expand Down

0 comments on commit afcf91a

Please sign in to comment.