Skip to content

Commit cbbf768

Browse files
authored
fix: button-group replaced gap with background-clip (#DS-5112) (#1691)
1 parent af6e64f commit cbbf768

4 files changed

Lines changed: 43 additions & 3 deletions

File tree

2.55 KB
Loading
-404 Bytes
Loading

packages/components/button/button-group.scss

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,55 @@
33
.kbq-button-group {
44
&.kbq-button-group_horizontal {
55
@include groups-mixins.group(':is(.kbq-button, .kbq-button-icon)');
6+
7+
& > :is(.kbq-button, .kbq-button-icon):not(:last-child, .cdk-keyboard-focused) {
8+
border-right-color: transparent;
9+
}
610
}
711

812
&.kbq-button-group_vertical {
913
@include groups-mixins.vertical-group(':is(.kbq-button, .kbq-button-icon)');
14+
15+
& > :is(.kbq-button, .kbq-button-icon):not(:last-child, .cdk-keyboard-focused) {
16+
border-bottom-color: transparent;
17+
}
1018
}
1119

1220
&:not(:has(> :not(.kbq-contrast-fade.kbq-button_filled))),
1321
&:not(:has(> :not(.kbq-contrast.kbq-button_filled))) {
14-
// @TODO tech debt (#DS-4847)
15-
gap: var(--kbq-size-3xs);
22+
:is(.kbq-button, .kbq-button-icon) {
23+
background-clip: padding-box !important;
24+
}
25+
}
26+
27+
&.kbq-contrast-fade.kbq-button-group-root_filled {
28+
// internal css variable, so don't prefixed with kbq
29+
--button-group-divider-color: var(--kbq-line-contrast-fade);
30+
31+
&.kbq-button-group_horizontal {
32+
:is(.kbq-button, .kbq-button-icon):not(:first-child)::before {
33+
content: '';
34+
position: absolute;
35+
// offset by -1px because absolute positioning is relative to the padding edge,
36+
// but the visual junction sits 1px to the left in the transparent border area
37+
left: calc(-1 * var(--kbq-size-border-width));
38+
top: 0;
39+
bottom: 0;
40+
width: var(--kbq-size-border-width);
41+
background: var(--button-group-divider-color);
42+
}
43+
}
44+
45+
&.kbq-button-group_vertical {
46+
:is(.kbq-button, .kbq-button-icon):not(:first-child)::before {
47+
content: '';
48+
position: absolute;
49+
top: calc(-1 * var(--kbq-size-border-width));
50+
left: 0;
51+
right: 0;
52+
height: var(--kbq-size-border-width);
53+
background: var(--button-group-divider-color);
54+
}
55+
}
1656
}
1757
}

packages/components/button/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export class E2eButtonStateAndStyle {
176176
}
177177
<tr>
178178
<td>
179-
<div class="layout-gap-3xs" kbq-button-group [kbqStyle]="style" [color]="color">
179+
<div kbq-button-group [kbqStyle]="style" [color]="color">
180180
<button kbq-button>
181181
<i kbq-icon="kbq-diamond_16"></i>
182182
{{ data[0] }}

0 commit comments

Comments
 (0)