Skip to content

Commit b8d2646

Browse files
committed
Refactor comment item layout and content rendering
1 parent 9febb5f commit b8d2646

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

packages/comment-widget/src/base-comment-item.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class BaseCommentItem extends LitElement {
6262
</div>
6363
6464
<div class="item__content markdown-body">
65-
<div><slot name="pre-content"></slot>${unsafeHTML(this.content)}</div>
65+
<slot name="pre-content"></slot>${unsafeHTML(this.content)}
6666
</div>
6767
6868
<div class="item__actions">
@@ -85,8 +85,14 @@ export class BaseCommentItem extends LitElement {
8585
padding: 1em 0;
8686
}
8787
88+
.item__avatar {
89+
flex: none;
90+
}
91+
8892
.item__main {
89-
flex: 1;
93+
flex: 1 1 auto;
94+
min-width: 0;
95+
width: 100%;
9096
}
9197
9298
.item__meta {
@@ -111,13 +117,6 @@ export class BaseCommentItem extends LitElement {
111117
margin-top: 0.5em;
112118
}
113119
114-
.item__content pre {
115-
color: var(--base-color);
116-
white-space: pre-wrap;
117-
overflow-wrap: break-word;
118-
word-break: break-all;
119-
}
120-
121120
.item__actions {
122121
margin-top: 0.5em;
123122
display: flex;

0 commit comments

Comments
 (0)