Skip to content

Commit 00201f2

Browse files
authored
fix(checkbox): max-width overflow (#DS-3644) (#713)
1 parent 835c70c commit 00201f2

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

packages/components/checkbox/checkbox.scss

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@
2727
}
2828

2929
.kbq-checkbox__layout {
30+
$padding-left: kbq-sum-series-css-variables(
31+
[checkbox-size-normal-width,
32+
checkbox-size-normal-horizontal-content-padding]
33+
);
34+
35+
// required for `.cdk-visually-hidden` input to be positioned correctly
3036
position: relative;
3137

3238
display: inline-flex;
3339

40+
max-width: calc(100% - $padding-left);
41+
3442
// `cursor: inherit` ensures that the wrapper element gets the same cursor as the kbq-checkbox
3543
// (e.g. pointer by default, regular when disabled), instead of the browser default.
3644
cursor: inherit;
@@ -39,10 +47,7 @@
3947

4048
padding-bottom: var(--kbq-checkbox-size-normal-padding-bottom);
4149

42-
padding-left: kbq-sum-series-css-variables(
43-
[checkbox-size-normal-width,
44-
checkbox-size-normal-horizontal-content-padding]
45-
);
50+
padding-left: $padding-left;
4651

4752
vertical-align: top;
4853
}
@@ -53,9 +58,6 @@
5358
position: absolute;
5459
top: var(--kbq-checkbox-size-normal-top);
5560
left: 0;
56-
57-
height: var(--kbq-checkbox-size-normal-width);
58-
width: var(--kbq-checkbox-size-normal-width);
5961
}
6062

6163
.kbq-checkbox {
@@ -64,6 +66,8 @@
6466
cursor: pointer;
6567
-webkit-tap-highlight-color: transparent;
6668

69+
max-width: 100%;
70+
6771
&.kbq-checked {
6872
.kbq-checkbox-checkmark {
6973
display: block;
@@ -99,10 +103,14 @@
99103

100104
.kbq-checkbox.kbq-checkbox_big {
101105
& .kbq-checkbox__layout {
102-
padding-left: kbq-sum-series-css-variables(
106+
$padding-left: kbq-sum-series-css-variables(
103107
[ checkbox-size-normal-width,
104108
checkbox-size-normal-horizontal-content-padding]
105109
);
110+
111+
max-width: calc(100% - $padding-left);
112+
113+
padding-left: $padding-left;
106114
}
107115

108116
& .kbq-checkbox__inner-container {
@@ -128,6 +136,8 @@
128136
.kbq-checkbox__text-container {
129137
display: flex;
130138
flex-direction: column;
139+
140+
max-width: 100%;
131141
}
132142

133143
.kbq-checkbox__inner-container_no-side-margin {

0 commit comments

Comments
 (0)