File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 96
96
}
97
97
98
98
.primary.action {
99
+ // Set a min-width on the primary action so that trailing actions remain
100
+ // inside the chip as the chip is resized.
101
+ min-width : 0 ;
99
102
padding-inline-start : var (--_leading-space );
100
103
padding-inline-end : var (--_trailing-space );
101
104
}
151
154
display : flex ;
152
155
font-family : var (--_label-text-font );
153
156
font-size : var (--_label-text-size );
154
- line-height : var (--_label-text-line-height );
155
157
font-weight : var (--_label-text-weight );
156
158
height : 100% ;
157
- text-overflow : ellipsis ;
159
+ line-height : var (--_label-text-line-height );
160
+ overflow : hidden ;
158
161
user-select : none ;
162
+ }
163
+
164
+ // An inner span is needed to truncate the label, since elements with a flex
165
+ // display do not support the text-overflow property. The outer wrapper .label
166
+ // needs to be a flex display to correctly set the element's baseline,
167
+ // supporting external elements aligning to the baseline of the chip's text
168
+ // instead of its edges or icons.
169
+ .label-text {
170
+ overflow : hidden ;
171
+ text-overflow : ellipsis ;
159
172
white-space : nowrap ;
160
173
}
161
174
Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ export abstract class Chip extends chipBaseClass {
128
128
< span class ="leading icon " aria-hidden ="true ">
129
129
${ this . renderLeadingIcon ( ) }
130
130
</ span >
131
- < span class ="label "> ${ this . label } </ span >
131
+ < span class ="label ">
132
+ < span class ="label-text "> ${ this . label } </ span >
133
+ </ span >
132
134
< span class ="touch "> </ span >
133
135
` ;
134
136
}
You can’t perform that action at this time.
0 commit comments