Skip to content

Commit 6de545a

Browse files
committed
Improve comment widget UI and styles
1 parent ace1c1a commit 6de545a

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,21 @@ export class BaseForm extends LitElement {
148148
}
149149

150150
renderAccountInfo() {
151-
return html`<div class="form__account-info">
151+
return html`<div class="form-account flex items-center gap-2">
152+
<div class="form-account-avatar avatar">
152153
${
153154
this.currentUser?.spec.avatar
154-
? html`<img src=${this.currentUser.spec.avatar} />`
155+
? html`<img src=${this.currentUser.spec.avatar} class="size-full object-cover" />`
155156
: ''
156157
}
157-
<span>
158+
</div>
159+
<span class="form-account-name text-base text-gray-900 font-semibold">
158160
${this.currentUser?.spec.displayName || this.currentUser?.metadata.name}
159161
</span>
160162
<button
161163
@click=${this.handleLogout}
162164
type="button"
163-
class="form__button--logout"
165+
class="form-logout text-xs text-gray-700 hover:text-gray-900 px-2 transition-all py-1 rounded-md border border-gray-100 opacity-90 hover:border-gray-200 hover:opacity-100 border-solid"
164166
>
165167
${msg('Logout')}
166168
</button>
@@ -265,11 +267,11 @@ export class BaseForm extends LitElement {
265267
<button
266268
.disabled=${this.submitting}
267269
type="submit"
268-
class="form-submit h-10 inline-flex items-center justify-center gap-2 bg-green text-white px-2 rounded-md hover:opacity-80"
270+
class="form-submit h-10 inline-flex text-sm items-center justify-center gap-2 bg-green text-white px-2 rounded-md hover:opacity-80 transition-all"
269271
>
270272
${
271273
this.submitting
272-
? html` <icon-loading></icon-loading>`
274+
? html`<icon-loading></icon-loading>`
273275
: html`<i class="i-mingcute-send-line size-5"></i>`
274276
}
275277
${msg('Submit')}

packages/comment-widget/src/comment-editor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export class CommentEditor extends LitElement {
150150
<div
151151
class="border rounded-md border-solid border-[var(--component-form-input-border-color)] focus-within:border-[var(--component-form-input-border-color-focus)] transition-all"
152152
?hidden=${this.loading}
153+
@click=${this.setFocus}
153154
>
154155
<div
155156
id="editor-container"

packages/comment-widget/src/styles/content.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
white-space: pre;
277277
background: transparent;
278278
border: 0;
279+
color: #fff;
279280
}
280281

281282
.markdown-body pre {

packages/comment-widget/uno.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineConfig({
1111
'icon-button-text':
1212
'select-none text-xs text-[var(--base-info-color)] group-hover:text-[var(--component-comment-item-action-color-hover)]',
1313
'pagination-button':
14-
'inline-flex items-center gap-1 hover:bg-gray-100 rounded-md py-1.5 px-2 transition-all text-gray-900 opacity-80 disabled:!opacity-70 disabled:cursor-not-allowed hover:opacity-100 font-medium justify-center',
14+
'inline-flex items-center text-sm gap-1 hover:bg-gray-100 rounded-md py-1.5 px-2 transition-all text-gray-900 opacity-80 disabled:!opacity-70 disabled:cursor-not-allowed hover:opacity-100 font-medium justify-center',
1515
avatar:
1616
'rounded-full size-9 overflow-hidden inline-flex items-center justify-center bg-gray-100',
1717
},

0 commit comments

Comments
 (0)