File tree Expand file tree Collapse file tree 4 files changed +34
-5
lines changed
uui-card-content-node/lib Expand file tree Collapse file tree 4 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ export class UUICardBlockTypeElement extends UUICardElement {
9696 #renderContent( ) {
9797 return html `
9898 <div id= "content" >
99- <span id= "name" > ${ this . name } </ span>
100- <small> ${ this . description } <slot name= "description" > </ slot> </ small>
99+ <span title = " ${ this . name } " id = "name"> ${ this . name } </ span>
100+ <small title = " ${ this . description } " > ${ this . description } <slot name= "description" > </ slot> </ small>
101101 </ div> </ div>
102102 ` ;
103103 }
@@ -176,6 +176,15 @@ export class UUICardBlockTypeElement extends UUICardElement {
176176 # open-part : hover # name {
177177 text-decoration : underline;
178178 }
179+ # open-part # name ,
180+ # open-part small {
181+ display : -webkit-box;
182+ -webkit-line-clamp : 1 ;
183+ -webkit-box-orient : vertical;
184+ overflow : hidden;
185+ text-overflow : ellipsis;
186+ overflow-wrap : anywhere;
187+ }
179188
180189 : host ([image ]: not ([image = '' ])) # open-part {
181190 transition : opacity 0.5s 0.5s ;
Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ export class UUICardContentNodeElement extends UUICardElement {
7676 ? this . _renderFallbackIcon ( )
7777 : '' }
7878 </ span>
79- <div id= "name" > ${ this . name } <slot name= "name" > </ slot> </ div>
79+ <div title= "${ this . name } " id = "name" >
80+ ${ this . name } <slot name= "name" > </ slot>
81+ </ div>
8082 </ span>
8183 ${ this . renderDetail ( ) }
8284 </ span>
@@ -173,6 +175,15 @@ export class UUICardContentNodeElement extends UUICardElement {
173175 padding : var (--uui-size-space-4 ) var (--uui-size-space-5 );
174176 }
175177
178+ # open-part # name {
179+ display : -webkit-box;
180+ -webkit-line-clamp : 2 ;
181+ -webkit-box-orient : vertical;
182+ overflow : hidden;
183+ text-overflow : ellipsis;
184+ overflow-wrap : anywhere;
185+ }
186+
176187 # content {
177188 align-self : stretch;
178189 display : flex;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export class UUICardUserElement extends UUICardElement {
7676 name= "avatar"
7777 class = "avatar"
7878 @slotchange = ${ this . _avatarSlotChanged } > </ slot>
79- <span> ${ this . name } </ span>
79+ <span title = " ${ this . name } " > ${ this . name } </ span>
8080 <slot> </ slot>
8181 </ div> ` ;
8282 }
@@ -159,12 +159,19 @@ export class UUICardUserElement extends UUICardElement {
159159 position : relative;
160160 align-items : center;
161161 margin : 0 0 3px 0 ;
162+ height : 100% ;
162163 }
163164
164165 # content > span {
166+ display : -webkit-box;
167+ -webkit-line-clamp : 2 ;
168+ -webkit-box-orient : vertical;
169+ overflow : hidden;
170+ text-overflow : ellipsis;
165171 vertical-align : center;
166172 margin-top : 3px ;
167173 font-weight : 700 ;
174+ overflow-wrap : anywhere;
168175 }
169176
170177 .avatar {
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ function renderSlots(param: TemplateResult[] | Args) {
3434 // Join slots with consistent formatting; no extra line breaks between them
3535 const spacing = ' ' ;
3636
37- const stringSlots = validSlots . map ( slot => slot . strings [ 0 ] ) ;
37+ const stringSlots = validSlots . map ( slot =>
38+ typeof slot === 'string' ? slot : slot . strings ?. [ 0 ] ?? '' ,
39+ ) ;
3840 const stringSlotsJoined = stringSlots . join ( '\n' ) ;
3941 const stringSlotsJoinedWithSpacing = stringSlotsJoined
4042 . split ( '\n' )
You can’t perform that action at this time.
0 commit comments