Skip to content

Commit

Permalink
improve(design): Table padding when Card styles.body.padding is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
dengfuping committed Jun 27, 2024
1 parent a48560e commit 543a5f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/design/src/card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
tabList,
prefixCls: customizePrefixCls,
bodyStyle,
styles,
className,
...restProps
},
Expand All @@ -41,8 +42,11 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
const tabsPrefixCls = getPrefixCls('tabs', customizePrefixCls);
const { wrapSSR } = useStyle(prefixCls, tabsPrefixCls);

const zeroPaddingList = [0, '0', '0px'];
// card body has no padding
const noBodyPadding = [0, '0', '0px'].includes(bodyStyle?.padding);
const noBodyPadding =
zeroPaddingList.includes(bodyStyle?.padding) ||
zeroPaddingList.includes(styles?.body?.padding);

const cardCls = classNames(
{
Expand Down Expand Up @@ -88,6 +92,7 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
tabList={newTabList}
prefixCls={customizePrefixCls}
bodyStyle={bodyStyle}
styles={styles}
className={cardCls}
{...restProps}
>
Expand Down

0 comments on commit 543a5f7

Please sign in to comment.