File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 9696 }
9797
9898 .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 ;
99102 padding-inline-start : var (--_leading-space );
100103 padding-inline-end : var (--_trailing-space );
101104 }
151154 display : flex ;
152155 font-family : var (--_label-text-font );
153156 font-size : var (--_label-text-size );
154- line-height : var (--_label-text-line-height );
155157 font-weight : var (--_label-text-weight );
156158 height : 100% ;
157- text-overflow : ellipsis ;
159+ line-height : var (--_label-text-line-height );
160+ overflow : hidden ;
158161 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 ;
159172 white-space : nowrap ;
160173 }
161174
Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ export abstract class Chip extends chipBaseClass {
128128 < span class ="leading icon " aria-hidden ="true ">
129129 ${ this . renderLeadingIcon ( ) }
130130 </ span >
131- < span class ="label "> ${ this . label } </ span >
131+ < span class ="label ">
132+ < span class ="label-text "> ${ this . label } </ span >
133+ </ span >
132134 < span class ="touch "> </ span >
133135 ` ;
134136 }
You can’t perform that action at this time.
0 commit comments