From 5c54566cdcb1a00ec2d42565d5fc5ef09c50835f Mon Sep 17 00:00:00 2001 From: vagusX Date: Wed, 5 Jun 2024 19:08:22 +0800 Subject: [PATCH] fix: padding unit for Progress text-inner (#49250) Co-authored-by: afc163 --- components/progress/style/index.ts | 4 ++-- tests/shared/imageTest.tsx | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/progress/style/index.ts b/components/progress/style/index.ts index a97619019e..19bd1c72ed 100644 --- a/components/progress/style/index.ts +++ b/components/progress/style/index.ts @@ -1,5 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; -import { Keyframes } from '@ant-design/cssinjs'; +import { unit, Keyframes } from '@ant-design/cssinjs'; import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; @@ -189,7 +189,7 @@ const genBaseStyle: GenerateStyle = (token) => { width: '100%', height: '100%', marginInlineStart: 0, - padding: `0 ${token.paddingXXS}`, + padding: `0 ${unit(token.paddingXXS)}`, [`&${progressCls}-text-start`]: { justifyContent: 'start', }, diff --git a/tests/shared/imageTest.tsx b/tests/shared/imageTest.tsx index db58b2dc49..2936d2bbb9 100644 --- a/tests/shared/imageTest.tsx +++ b/tests/shared/imageTest.tsx @@ -215,18 +215,25 @@ export default function imageTest( } Object.entries(themes).forEach(([key, algorithm]) => { + const configTheme = { + algorithm, + token: { + fontFamily: 'Arial', + }, + }; + test( `component image screenshot should correct ${key}`, `.${key}`,
- {component} + {component}
, ); test( `[CSS Var] component image screenshot should correct ${key}`, `.${key}.css-var`,
- {component} + {component}
, ); });