mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +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;
|
radioSize: number;
|
||||||
radioTop: number;
|
radioTop: number;
|
||||||
radioDotSize: number;
|
radioDotSize: number;
|
||||||
|
radioDotDisabledSize: number;
|
||||||
radioDotColor: string;
|
radioDotColor: string;
|
||||||
radioDotDisabledColor: string;
|
radioDotDisabledColor: string;
|
||||||
radioSolidCheckedColor: string;
|
radioSolidCheckedColor: string;
|
||||||
@ -83,6 +84,7 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = token => {
|
|||||||
paddingXS,
|
paddingXS,
|
||||||
radioDotDisabledColor,
|
radioDotDisabledColor,
|
||||||
controlLineType,
|
controlLineType,
|
||||||
|
radioDotDisabledSize,
|
||||||
} = token;
|
} = token;
|
||||||
const radioInnerPrefixCls = `${componentCls}-inner`;
|
const radioInnerPrefixCls = `${componentCls}-inner`;
|
||||||
|
|
||||||
@ -232,6 +234,14 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = token => {
|
|||||||
color: colorTextDisabled,
|
color: colorTextDisabled,
|
||||||
cursor: 'not-allowed',
|
cursor: 'not-allowed',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
[`&${componentCls}-checked`]: {
|
||||||
|
[radioInnerPrefixCls]: {
|
||||||
|
'&::after': {
|
||||||
|
transform: `scale(${radioDotDisabledSize / radioSize})`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
[`span${componentCls} + *`]: {
|
[`span${componentCls} + *`]: {
|
||||||
@ -504,6 +514,7 @@ export default genComponentStyleHook('Radio', token => {
|
|||||||
const radioSize = fontSizeLG;
|
const radioSize = fontSizeLG;
|
||||||
const radioTop = (Math.round(fontSize * lineHeight) - radioSize) / 2;
|
const radioTop = (Math.round(fontSize * lineHeight) - radioSize) / 2;
|
||||||
const radioDotSize = radioSize - (paddingXXS + controlLineWidth) * 2;
|
const radioDotSize = radioSize - (paddingXXS + controlLineWidth) * 2;
|
||||||
|
const radioDotDisabledSize = radioSize - paddingXXS * 2;
|
||||||
const radioDotColor = colorPrimary;
|
const radioDotColor = colorPrimary;
|
||||||
|
|
||||||
// Radio buttons
|
// Radio buttons
|
||||||
@ -520,6 +531,7 @@ export default genComponentStyleHook('Radio', token => {
|
|||||||
radioSize,
|
radioSize,
|
||||||
radioTop,
|
radioTop,
|
||||||
radioDotSize,
|
radioDotSize,
|
||||||
|
radioDotDisabledSize,
|
||||||
radioDotColor,
|
radioDotColor,
|
||||||
radioDotDisabledColor: colorTextDisabled,
|
radioDotDisabledColor: colorTextDisabled,
|
||||||
radioSolidCheckedColor: colorBgContainer,
|
radioSolidCheckedColor: colorBgContainer,
|
||||||
|
Loading…
Reference in New Issue
Block a user