fix: checxbox style
parent
42cb6871ee
commit
2bf85998ba
|
@ -36,6 +36,13 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
|
||||||
...resetComponent(token),
|
...resetComponent(token),
|
||||||
|
|
||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
columnGap: token.marginXS,
|
||||||
|
|
||||||
|
// Group > Grid
|
||||||
|
[`> ${token.antCls}-row`]: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Wrapper
|
// Wrapper
|
||||||
|
@ -56,7 +63,7 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
|
||||||
|
|
||||||
// Checkbox near checkbox
|
// Checkbox near checkbox
|
||||||
[`& + ${wrapperCls}`]: {
|
[`& + ${wrapperCls}`]: {
|
||||||
marginInlineStart: token.marginXS,
|
marginInlineStart: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
[`&${wrapperCls}-in-form-item`]: {
|
[`&${wrapperCls}-in-form-item`]: {
|
||||||
|
@ -71,21 +78,26 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
|
||||||
[checkboxCls]: {
|
[checkboxCls]: {
|
||||||
...resetComponent(token),
|
...resetComponent(token),
|
||||||
|
|
||||||
top: '0.2em',
|
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
|
|
||||||
|
// To make alignment right when `controlHeight` is changed
|
||||||
|
// Ref: https://github.com/ant-design/ant-design/issues/41564
|
||||||
|
alignSelf: 'center',
|
||||||
|
|
||||||
// Wrapper > Checkbox > input
|
// Wrapper > Checkbox > input
|
||||||
[`${checkboxCls}-input`]: {
|
[`${checkboxCls}-input`]: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
// Since baseline align will get additional space offset,
|
||||||
|
// we need to move input to top to make it align with text.
|
||||||
|
// Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
|
||||||
inset: 0,
|
inset: 0,
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
|
margin: 0,
|
||||||
|
|
||||||
[`&:focus-visible + ${checkboxCls}-inner`]: {
|
[`&:focus-visible + ${checkboxCls}-inner`]: {
|
||||||
...genFocusOutline(token),
|
...genFocusOutline(token),
|
||||||
|
|
Loading…
Reference in New Issue