fix: padding unit for Progress text-inner (#49250)

Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
vagusX 2024-06-05 19:08:22 +08:00 committed by GitHub
parent 9a34206f53
commit 5c54566cdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View File

@ -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<ProgressToken> = (token) => {
width: '100%',
height: '100%',
marginInlineStart: 0,
padding: `0 ${token.paddingXXS}`,
padding: `0 ${unit(token.paddingXXS)}`,
[`&${progressCls}-text-start`]: {
justifyContent: 'start',
},

View File

@ -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}`,
<div style={{ background: key === 'dark' ? '#000' : '', padding: `24px 12px` }} key={key}>
<ConfigProvider theme={{ algorithm }}>{component}</ConfigProvider>
<ConfigProvider theme={configTheme}>{component}</ConfigProvider>
</div>,
);
test(
`[CSS Var] component image screenshot should correct ${key}`,
`.${key}.css-var`,
<div style={{ background: key === 'dark' ? '#000' : '', padding: `24px 12px` }} key={key}>
<ConfigProvider theme={{ algorithm, cssVar: true }}>{component}</ConfigProvider>
<ConfigProvider theme={{ ...configTheme, cssVar: true }}>{component}</ConfigProvider>
</div>,
);
});