Skip to content

Commit 124a658

Browse files
committed
fix(chip) styles for improved layout and responsiveness.
Replaces flex with grid to mathc angular implementation and to make ellipsis work. Simplifies margin logic by using `gap` and removes redundant parts' styles. Adds `ellipsis()` to truncate text and sets a max width for slotted content to match angular behavior.
1 parent abc545c commit 124a658

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/components/chip/themes/chip.base.scss

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@
22
@use 'styles/utilities' as *;
33

44
:host {
5-
display: inline-flex;
5+
display: inline-block;
66
vertical-align: top;
7+
height: ;
78
}
89

910
:host button {
1011
@include type-style('body-2');
12+
@include ellipsis();
1113

12-
display: flex;
14+
display: grid;
15+
grid-auto-flow: column;
1316
justify-content: center;
1417
align-items: center;
1518
font-family: var(--ig-font-family);
1619
border-style: none;
1720
box-shadow: none;
1821
cursor: pointer;
19-
padding: pad(2px, 6px, 12px);
22+
padding: 0 pad-inline(2px, 6px, 12px);
23+
gap: sizable(rem(3px), rem(6px), rem(8px));
2024

2125
&[disabled] {
2226
pointer-events: none;
@@ -110,14 +114,8 @@
110114
justify-content: center;
111115
}
112116

113-
[part='prefix'] {
114-
margin-inline-end: pad-inline(rem(3px), rem(6px), rem(8px));
115-
}
116-
117-
[part='suffix'] {
118-
margin-inline-start: pad-inline(rem(3px), rem(6px), rem(8px));
119-
}
120-
121117
::slotted(*) {
122-
display: flex;
118+
@include ellipsis();
119+
120+
max-width: 32ch;
123121
}

0 commit comments

Comments
 (0)