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 {
96
96
#renderContent( ) {
97
97
return html `
98
98
<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>
101
101
</ div> </ div>
102
102
` ;
103
103
}
@@ -176,6 +176,15 @@ export class UUICardBlockTypeElement extends UUICardElement {
176
176
# open-part : hover # name {
177
177
text-decoration : underline;
178
178
}
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
+ }
179
188
180
189
: host ([image ]: not ([image = '' ])) # open-part {
181
190
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 {
76
76
? this . _renderFallbackIcon ( )
77
77
: '' }
78
78
</ 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>
80
82
</ span>
81
83
${ this . renderDetail ( ) }
82
84
</ span>
@@ -173,6 +175,15 @@ export class UUICardContentNodeElement extends UUICardElement {
173
175
padding : var (--uui-size-space-4 ) var (--uui-size-space-5 );
174
176
}
175
177
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
+
176
187
# content {
177
188
align-self : stretch;
178
189
display : flex;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export class UUICardUserElement extends UUICardElement {
76
76
name= "avatar"
77
77
class = "avatar"
78
78
@slotchange = ${ this . _avatarSlotChanged } > </ slot>
79
- <span> ${ this . name } </ span>
79
+ <span title = " ${ this . name } " > ${ this . name } </ span>
80
80
<slot> </ slot>
81
81
</ div> ` ;
82
82
}
@@ -159,12 +159,19 @@ export class UUICardUserElement extends UUICardElement {
159
159
position : relative;
160
160
align-items : center;
161
161
margin : 0 0 3px 0 ;
162
+ height : 100% ;
162
163
}
163
164
164
165
# content > span {
166
+ display : -webkit-box;
167
+ -webkit-line-clamp : 2 ;
168
+ -webkit-box-orient : vertical;
169
+ overflow : hidden;
170
+ text-overflow : ellipsis;
165
171
vertical-align : center;
166
172
margin-top : 3px ;
167
173
font-weight : 700 ;
174
+ overflow-wrap : anywhere;
168
175
}
169
176
170
177
.avatar {
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ function renderSlots(param: TemplateResult[] | Args) {
34
34
// Join slots with consistent formatting; no extra line breaks between them
35
35
const spacing = ' ' ;
36
36
37
- const stringSlots = validSlots . map ( slot => slot . strings [ 0 ] ) ;
37
+ const stringSlots = validSlots . map ( slot =>
38
+ typeof slot === 'string' ? slot : slot . strings ?. [ 0 ] ?? '' ,
39
+ ) ;
38
40
const stringSlotsJoined = stringSlots . join ( '\n' ) ;
39
41
const stringSlotsJoinedWithSpacing = stringSlotsJoined
40
42
. split ( '\n' )
You can’t perform that action at this time.
0 commit comments