File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
components/checkbox/style Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
36
36
...resetComponent ( token ) ,
37
37
38
38
display : 'inline-flex' ,
39
+ flexWrap : 'wrap' ,
40
+ columnGap : token . marginXS ,
41
+
42
+ // Group > Grid
43
+ [ `> ${ token . antCls } -row` ] : {
44
+ flex : 1 ,
45
+ } ,
39
46
} ,
40
47
41
48
// Wrapper
@@ -56,7 +63,7 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
56
63
57
64
// Checkbox near checkbox
58
65
[ `& + ${ wrapperCls } ` ] : {
59
- marginInlineStart : token . marginXS ,
66
+ marginInlineStart : 0 ,
60
67
} ,
61
68
62
69
[ `&${ wrapperCls } -in-form-item` ] : {
@@ -71,21 +78,26 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
71
78
[ checkboxCls ] : {
72
79
...resetComponent ( token ) ,
73
80
74
- top : '0.2em' ,
75
81
position : 'relative' ,
76
82
whiteSpace : 'nowrap' ,
77
83
lineHeight : 1 ,
78
84
cursor : 'pointer' ,
79
85
86
+ // To make alignment right when `controlHeight` is changed
87
+ // Ref: https://github.com/ant-design/ant-design/issues/41564
88
+ alignSelf : 'center' ,
89
+
80
90
// Wrapper > Checkbox > input
81
91
[ `${ checkboxCls } -input` ] : {
82
92
position : 'absolute' ,
93
+ // Since baseline align will get additional space offset,
94
+ // we need to move input to top to make it align with text.
95
+ // Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
83
96
inset : 0 ,
84
97
zIndex : 1 ,
85
- width : '100%' ,
86
- height : '100%' ,
87
98
cursor : 'pointer' ,
88
99
opacity : 0 ,
100
+ margin : 0 ,
89
101
90
102
[ `&:focus-visible + ${ checkboxCls } -inner` ] : {
91
103
...genFocusOutline ( token ) ,
You can’t perform that action at this time.
0 commit comments