contentcss
Comment
Comment threads with avatar, header, meta, and body sections, nested replies, and a highlighted primary comment.
CSS Variables
| Variable | Default | Scope | Description |
|---|---|---|---|
--z-comment-avatar-bg | var(--z-muted) | .z-comment-avatar | Avatar background base color, mixed with transparency using --z-comment-avatar-bg-o. |
--z-comment-avatar-bg-o | 4% | .z-comment-avatar | Avatar background opacity percentage used in the mix. |
--z-comment-avatar-radius | 9999px | .z-comment-avatar | Corner radius of the avatar. |
--z-comment-avatar-size | 2.5rem | .z-comment-avatar | Width and height of the avatar. |
--z-comment-header-margin | 1.25rem | .z-comment-header | Block-end margin of the header. |
--z-comment-list-gap | 0.75rem | .z-comment-list > :nth-child(n + 2) | Block-start margin of the reply list. |
--z-comment-meta-font-size | 0.75rem | .z-comment-meta | Font size of the meta line. |
--z-comment-meta-line-height | 1rem | .z-comment-meta | Line height of the meta line. |
--z-comment-meta-margin-top | 0.25rem | .z-comment-meta | Block-start margin of the meta line. |
--z-comment-nested-border-color | var(--z-border) | .z-comment-list .z-comment ~ ul | Reply thread border base color, mixed with transparency using --z-comment-nested-border-color-o. |
--z-comment-nested-border-color-o | var(--z-border-o) | .z-comment-list .z-comment ~ ul | Reply thread border opacity percentage used in the mix. |
--z-comment-nested-border-width | 1px | .z-comment-list .z-comment ~ ul | Inline-start border width of the reply thread. |
--z-comment-nested-item-gap | 1.5rem | .z-comment-list .z-comment ~ ul > :nth-child(n + 2) | Block-start margin between nested items. |
--z-comment-nested-item-margin | 0.75rem | .z-comment-list .z-comment ~ ul > li | Inline-start margin of each nested item. |
--z-comment-nested-margin | 1.5rem | .z-comment-list .z-comment ~ ul | Inline-start margin of nested replies. |
--z-comment-nested-margin-top | 1.5rem | .z-comment-list .z-comment ~ ul | Block-start margin of nested replies. |
--z-comment-padding | 0.75rem | .z-comment | Padding of the comment body area. |
--z-comment-primary-bg | var(--z-primary) | .z-comment-primary | Primary comment background base color, mixed with transparency using --z-comment-primary-bg-o. |
--z-comment-primary-bg-o | 100% | .z-comment-primary | Primary comment background opacity percentage used in the mix. |
--z-comment-primary-color | var(--z-primary-f) | .z-comment-primary | Primary comment text base color, mixed with transparency using --z-comment-primary-color-o. |
--z-comment-primary-color-o | 100% | .z-comment-primary | Primary comment text opacity percentage used in the mix. |
--z-comment-primary-radius | var(--z-global-radius) | .z-comment-primary | Corner radius of the primary comment. |
--z-comment-title-font-size | 1rem | .z-comment-title | Font size of the title. |
--z-comment-title-font-weight | 500 | .z-comment-title | Font weight of the title. |
CSS Classes
| Class | Role | Applies to | Description |
|---|---|---|---|
.z-comment | root | .z-comment | Root class of one comment. |
.z-comment-avatar | element | .z-comment | Avatar slot beside the comment. |
.z-comment-body | element | .z-comment | Comment content body. |
.z-comment-header | element | .z-comment | Header row holding title and meta. |
.z-comment-list | element | .z-comment | List of nested replies. |
.z-comment-meta | element | .z-comment | Secondary meta line (date, actions). |
.z-comment-primary | element | .z-comment | Highlighted primary comment with tinted background. |
.z-comment-title | element | .z-comment | Author/title text. |
Accessibility
- Structure threads as lists; give avatars alt text or mark them decorative, and keep meta actions keyboard-reachable.