chore: fix input css var (#52887)

* chore: fix input css var

* Update debug-token.tsx

Signed-off-by: 二货爱吃白萝卜 <smith3816@gmail.com>

---------

Signed-off-by: 二货爱吃白萝卜 <smith3816@gmail.com>
This commit is contained in:
二货爱吃白萝卜 2025-02-19 14:11:05 +08:00 committed by GitHub
parent 3bc18c3370
commit 9b854e43dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,17 +135,21 @@ export const initComponentToken = (
const mergedFontSizeSM = inputFontSizeSM || mergedFontSize;
const mergedFontSizeLG = inputFontSizeLG || fontSizeLG;
const paddingBlock = Math.max(
Math.round(((controlHeight - mergedFontSize * lineHeight) / 2) * 10) / 10 - lineWidth,
0,
);
const paddingBlockSM = Math.max(
Math.round(((controlHeightSM - mergedFontSizeSM * lineHeight) / 2) * 10) / 10 - lineWidth,
0,
);
const paddingBlockLG =
Math.ceil(((controlHeightLG - mergedFontSizeLG * lineHeightLG) / 2) * 10) / 10 - lineWidth;
return {
paddingBlock: Math.max(
Math.round(((controlHeight - mergedFontSize * lineHeight) / 2) * 10) / 10 - lineWidth,
0,
),
paddingBlockSM: Math.max(
Math.round(((controlHeightSM - mergedFontSizeSM * lineHeight) / 2) * 10) / 10 - lineWidth,
0,
),
paddingBlockLG:
Math.ceil(((controlHeightLG - mergedFontSizeLG * lineHeightLG) / 2) * 10) / 10 - lineWidth,
paddingBlock: Math.max(paddingBlock, 0),
paddingBlockSM: Math.max(paddingBlockSM, 0),
paddingBlockLG: Math.max(paddingBlockLG, 0),
paddingInline: paddingSM - lineWidth,
paddingInlineSM: controlPaddingHorizontalSM - lineWidth,
paddingInlineLG: controlPaddingHorizontal - lineWidth,