Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 378549e

Browse files
tripleWdotcomTigge
authored andcommitted
fix(button): icon don't overflow and buttons are aligned
1 parent cc838ea commit 378549e

File tree

6 files changed

+34
-3
lines changed

6 files changed

+34
-3
lines changed

packages/core/src/Button/__snapshots__/index.test.tsx.snap

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ exports[`Button primary 1`] = `
1515
}
1616
1717
.c2 {
18+
vertical-align: middle;
1819
white-space: nowrap;
1920
height: 32px;
2021
outline: none;
@@ -169,6 +170,7 @@ exports[`Button primary 2`] = `
169170
}
170171
171172
.c2 {
173+
vertical-align: middle;
172174
white-space: nowrap;
173175
height: 32px;
174176
outline: none;
@@ -333,6 +335,7 @@ exports[`Button secondary 1`] = `
333335
}
334336
335337
.c2 {
338+
vertical-align: middle;
336339
white-space: nowrap;
337340
height: 32px;
338341
outline: none;
@@ -488,6 +491,7 @@ exports[`Button secondary 2`] = `
488491
}
489492
490493
.c2 {
494+
vertical-align: middle;
491495
white-space: nowrap;
492496
height: 32px;
493497
outline: none;
@@ -653,6 +657,7 @@ exports[`Button secondary 3`] = `
653657
}
654658
655659
.c2 {
660+
vertical-align: middle;
656661
white-space: nowrap;
657662
height: 32px;
658663
outline: none;
@@ -818,6 +823,7 @@ exports[`Button secondary 4`] = `
818823
}
819824
820825
.c2 {
826+
vertical-align: middle;
821827
white-space: nowrap;
822828
height: 32px;
823829
outline: none;
@@ -983,6 +989,7 @@ exports[`Button secondary 5`] = `
983989
}
984990
985991
.c2 {
992+
vertical-align: middle;
986993
white-space: nowrap;
987994
height: 32px;
988995
outline: none;
@@ -1161,6 +1168,7 @@ exports[`IconButton primary 1`] = `
11611168
}
11621169
11631170
.c2 {
1171+
vertical-align: middle;
11641172
white-space: nowrap;
11651173
height: 32px;
11661174
outline: none;
@@ -1324,6 +1332,7 @@ exports[`IconButton primary 2`] = `
13241332
}
13251333
13261334
.c2 {
1335+
vertical-align: middle;
13271336
white-space: nowrap;
13281337
height: 32px;
13291338
outline: none;
@@ -1498,6 +1507,7 @@ exports[`IconButton secondary 1`] = `
14981507
}
14991508
15001509
.c2 {
1510+
vertical-align: middle;
15011511
white-space: nowrap;
15021512
height: 32px;
15031513
outline: none;
@@ -1719,6 +1729,7 @@ exports[`IconButton secondary 2`] = `
17191729
}
17201730
17211731
.c2 {
1732+
vertical-align: middle;
17221733
white-space: nowrap;
17231734
height: 32px;
17241735
outline: none;
@@ -1951,6 +1962,7 @@ exports[`IconButton secondary 3`] = `
19511962
}
19521963
19531964
.c2 {
1965+
vertical-align: middle;
19541966
white-space: nowrap;
19551967
height: 32px;
19561968
outline: none;
@@ -2172,6 +2184,7 @@ exports[`IconButton secondary 4`] = `
21722184
}
21732185
21742186
.c2 {
2187+
vertical-align: middle;
21752188
white-space: nowrap;
21762189
height: 32px;
21772190
outline: none;
@@ -2441,6 +2454,7 @@ exports[`IconTextButton primary 1`] = `
24412454
}
24422455
24432456
.c2 {
2457+
vertical-align: middle;
24442458
white-space: nowrap;
24452459
height: 32px;
24462460
outline: none;
@@ -2494,6 +2508,7 @@ exports[`IconTextButton primary 1`] = `
24942508
}
24952509
24962510
.c6 {
2511+
box-sizing: border-box;
24972512
height: 32px;
24982513
width: 32px;
24992514
color: rgb(255,255,255);
@@ -2660,6 +2675,7 @@ exports[`IconTextButton primary 2`] = `
26602675
}
26612676
26622677
.c2 {
2678+
vertical-align: middle;
26632679
white-space: nowrap;
26642680
height: 32px;
26652681
outline: none;
@@ -2713,6 +2729,7 @@ exports[`IconTextButton primary 2`] = `
27132729
}
27142730
27152731
.c6 {
2732+
box-sizing: border-box;
27162733
height: 32px;
27172734
width: 32px;
27182735
color: rgb(255,255,255);

packages/core/src/Button/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const BUTTON_MIN_WIDTH = '83px'
1010

1111
//Common CSS for NativeButton and NativeIconTextButton
1212
const COMMON_STYLE = css`
13+
vertical-align: middle;
1314
white-space: nowrap;
1415
height: ${componentSize.small};
1516
outline: none;
@@ -547,6 +548,7 @@ export const NativeIconTextButton = styled.button<{
547548
const IconContainer = styled(Icon)`
548549
${({ theme }) => {
549550
return css`
551+
box-sizing: border-box;
550552
height: ${componentSize.small};
551553
width: ${componentSize.small};
552554
color: ${theme.color.text00()};

packages/core/src/DateTimePicker/__snapshots__/index.test.tsx.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ exports[`DateTimePicker DatePicker 1`] = `
3939
}
4040
4141
.c4 {
42+
vertical-align: middle;
4243
white-space: nowrap;
4344
height: 32px;
4445
outline: none;
@@ -86,6 +87,7 @@ exports[`DateTimePicker DatePicker 1`] = `
8687
}
8788
8889
.c16 {
90+
vertical-align: middle;
8991
white-space: nowrap;
9092
height: 32px;
9193
outline: none;
@@ -127,6 +129,7 @@ exports[`DateTimePicker DatePicker 1`] = `
127129
}
128130
129131
.c19 {
132+
vertical-align: middle;
130133
white-space: nowrap;
131134
height: 32px;
132135
outline: none;
@@ -1143,6 +1146,7 @@ exports[`DateTimePicker DateTimePicker 1`] = `
11431146
}
11441147
11451148
.c39 {
1149+
vertical-align: middle;
11461150
white-space: nowrap;
11471151
height: 32px;
11481152
outline: none;
@@ -1189,6 +1193,7 @@ exports[`DateTimePicker DateTimePicker 1`] = `
11891193
}
11901194
11911195
.c42 {
1196+
vertical-align: middle;
11921197
white-space: nowrap;
11931198
height: 32px;
11941199
outline: none;
@@ -2348,6 +2353,7 @@ exports[`DateTimePicker DateTimePicker 2`] = `
23482353
}
23492354
23502355
.c51 {
2356+
vertical-align: middle;
23512357
white-space: nowrap;
23522358
height: 32px;
23532359
outline: none;
@@ -2394,6 +2400,7 @@ exports[`DateTimePicker DateTimePicker 2`] = `
23942400
}
23952401
23962402
.c54 {
2403+
vertical-align: middle;
23972404
white-space: nowrap;
23982405
height: 32px;
23992406
outline: none;
@@ -3739,6 +3746,7 @@ exports[`DateTimePicker TimePickers 1`] = `
37393746
}
37403747
37413748
.c21 {
3749+
vertical-align: middle;
37423750
white-space: nowrap;
37433751
height: 32px;
37443752
outline: none;
@@ -3785,6 +3793,7 @@ exports[`DateTimePicker TimePickers 1`] = `
37853793
}
37863794
37873795
.c24 {
3796+
vertical-align: middle;
37883797
white-space: nowrap;
37893798
height: 32px;
37903799
outline: none;

packages/core/src/FilePicker/__snapshots__/index.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ exports[`FilePicker FilePicker 1`] = `
2626
}
2727
2828
.c3 {
29+
vertical-align: middle;
2930
white-space: nowrap;
3031
height: 32px;
3132
outline: none;
@@ -228,6 +229,7 @@ exports[`FilePicker FilePicker 2`] = `
228229
}
229230
230231
.c3 {
232+
vertical-align: middle;
231233
white-space: nowrap;
232234
height: 32px;
233235
outline: none;

packages/core/src/Stepper/__snapshots__/index.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ exports[`Stepper Stepper 1`] = `
4949
}
5050
5151
.c13 {
52+
vertical-align: middle;
5253
white-space: nowrap;
5354
height: 32px;
5455
outline: none;
@@ -457,6 +458,7 @@ exports[`Stepper Stepper 2`] = `
457458
}
458459
459460
.c13 {
461+
vertical-align: middle;
460462
white-space: nowrap;
461463
height: 32px;
462464
outline: none;
@@ -826,6 +828,7 @@ exports[`Stepper Stepper 3`] = `
826828
}
827829
828830
.c12 {
831+
vertical-align: middle;
829832
white-space: nowrap;
830833
height: 32px;
831834
outline: none;

packages/docs/src/mdx/coreComponents/Button.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ Buttons allow users to take actions, and make choices, with a single tap.
2121

2222
export const Wrapper = styled.div`
2323
> * {
24-
vertical-align: middle;
25-
margin-right: 4px;
26-
margin-bottom: 4px;
24+
margin: 4px;
2725
}
2826
`
2927

0 commit comments

Comments
 (0)