From 42953246f36bafb7deeaae27b8fbf4c515d036bc Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Thu, 8 Sep 2022 16:05:26 +0800 Subject: [PATCH] feat: v5 radio disabled dot size (#37469) --- components/radio/style/index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/radio/style/index.tsx b/components/radio/style/index.tsx index a40c086052..14017c1b86 100644 --- a/components/radio/style/index.tsx +++ b/components/radio/style/index.tsx @@ -13,6 +13,7 @@ interface RadioToken extends FullToken<'Radio'> { radioSize: number; radioTop: number; radioDotSize: number; + radioDotDisabledSize: number; radioDotColor: string; radioDotDisabledColor: string; radioSolidCheckedColor: string; @@ -83,6 +84,7 @@ const getRadioBasicStyle: GenerateStyle = token => { paddingXS, radioDotDisabledColor, controlLineType, + radioDotDisabledSize, } = token; const radioInnerPrefixCls = `${componentCls}-inner`; @@ -232,6 +234,14 @@ const getRadioBasicStyle: GenerateStyle = token => { color: colorTextDisabled, cursor: 'not-allowed', }, + + [`&${componentCls}-checked`]: { + [radioInnerPrefixCls]: { + '&::after': { + transform: `scale(${radioDotDisabledSize / radioSize})`, + }, + }, + }, }, [`span${componentCls} + *`]: { @@ -504,6 +514,7 @@ export default genComponentStyleHook('Radio', token => { const radioSize = fontSizeLG; const radioTop = (Math.round(fontSize * lineHeight) - radioSize) / 2; const radioDotSize = radioSize - (paddingXXS + controlLineWidth) * 2; + const radioDotDisabledSize = radioSize - paddingXXS * 2; const radioDotColor = colorPrimary; // Radio buttons @@ -520,6 +531,7 @@ export default genComponentStyleHook('Radio', token => { radioSize, radioTop, radioDotSize, + radioDotDisabledSize, radioDotColor, radioDotDisabledColor: colorTextDisabled, radioSolidCheckedColor: colorBgContainer,