mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 01:13:58 +08:00
feat: v5 radio disabled dot size (#37469)
This commit is contained in:
parent
6c06792bfd
commit
42953246f3
@ -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<RadioToken> = token => {
|
||||
paddingXS,
|
||||
radioDotDisabledColor,
|
||||
controlLineType,
|
||||
radioDotDisabledSize,
|
||||
} = token;
|
||||
const radioInnerPrefixCls = `${componentCls}-inner`;
|
||||
|
||||
@ -232,6 +234,14 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = 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,
|
||||
|
Loading…
Reference in New Issue
Block a user