From 543a5f71cdd9b83066aab0041c710c6dd22ba59b Mon Sep 17 00:00:00 2001 From: dengfuping Date: Thu, 27 Jun 2024 12:00:57 +0800 Subject: [PATCH] improve(design): Table padding when Card styles.body.padding is 0 --- packages/design/src/card/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/design/src/card/index.tsx b/packages/design/src/card/index.tsx index 5afe2b426..ceeda18be 100644 --- a/packages/design/src/card/index.tsx +++ b/packages/design/src/card/index.tsx @@ -31,6 +31,7 @@ const Card = React.forwardRef( tabList, prefixCls: customizePrefixCls, bodyStyle, + styles, className, ...restProps }, @@ -41,8 +42,11 @@ const Card = React.forwardRef( 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( { @@ -88,6 +92,7 @@ const Card = React.forwardRef( tabList={newTabList} prefixCls={customizePrefixCls} bodyStyle={bodyStyle} + styles={styles} className={cardCls} {...restProps} >