Skip to content

Commit b9744a9

Browse files
committed
fix overflow for content card and block card
1 parent f4797c0 commit b9744a9

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

packages/uui-card-block-type/lib/uui-card-block-type.element.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

packages/uui-card-content-node/lib/uui-card-content-node.element.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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,14 @@ 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+
}
185+
176186
#content {
177187
align-self: stretch;
178188
display: flex;

0 commit comments

Comments
 (0)