contentcss

Comment

Comment threads with avatar, header, meta, and body sections, nested replies, and a highlighted primary comment.

CSS Variables

VariableDefaultScopeDescription
--z-comment-avatar-bgvar(--z-muted).z-comment-avatarAvatar background base color, mixed with transparency using --z-comment-avatar-bg-o.
--z-comment-avatar-bg-o4%.z-comment-avatarAvatar background opacity percentage used in the mix.
--z-comment-avatar-radius9999px.z-comment-avatarCorner radius of the avatar.
--z-comment-avatar-size2.5rem.z-comment-avatarWidth and height of the avatar.
--z-comment-header-margin1.25rem.z-comment-headerBlock-end margin of the header.
--z-comment-list-gap0.75rem.z-comment-list > :nth-child(n + 2)Block-start margin of the reply list.
--z-comment-meta-font-size0.75rem.z-comment-metaFont size of the meta line.
--z-comment-meta-line-height1rem.z-comment-metaLine height of the meta line.
--z-comment-meta-margin-top0.25rem.z-comment-metaBlock-start margin of the meta line.
--z-comment-nested-border-colorvar(--z-border).z-comment-list .z-comment ~ ulReply thread border base color, mixed with transparency using --z-comment-nested-border-color-o.
--z-comment-nested-border-color-ovar(--z-border-o).z-comment-list .z-comment ~ ulReply thread border opacity percentage used in the mix.
--z-comment-nested-border-width1px.z-comment-list .z-comment ~ ulInline-start border width of the reply thread.
--z-comment-nested-item-gap1.5rem.z-comment-list .z-comment ~ ul > :nth-child(n + 2)Block-start margin between nested items.
--z-comment-nested-item-margin0.75rem.z-comment-list .z-comment ~ ul > liInline-start margin of each nested item.
--z-comment-nested-margin1.5rem.z-comment-list .z-comment ~ ulInline-start margin of nested replies.
--z-comment-nested-margin-top1.5rem.z-comment-list .z-comment ~ ulBlock-start margin of nested replies.
--z-comment-padding0.75rem.z-commentPadding of the comment body area.
--z-comment-primary-bgvar(--z-primary).z-comment-primaryPrimary comment background base color, mixed with transparency using --z-comment-primary-bg-o.
--z-comment-primary-bg-o100%.z-comment-primaryPrimary comment background opacity percentage used in the mix.
--z-comment-primary-colorvar(--z-primary-f).z-comment-primaryPrimary comment text base color, mixed with transparency using --z-comment-primary-color-o.
--z-comment-primary-color-o100%.z-comment-primaryPrimary comment text opacity percentage used in the mix.
--z-comment-primary-radiusvar(--z-global-radius).z-comment-primaryCorner radius of the primary comment.
--z-comment-title-font-size1rem.z-comment-titleFont size of the title.
--z-comment-title-font-weight500.z-comment-titleFont weight of the title.

CSS Classes

ClassRoleApplies toDescription
.z-commentroot.z-commentRoot class of one comment.
.z-comment-avatarelement.z-commentAvatar slot beside the comment.
.z-comment-bodyelement.z-commentComment content body.
.z-comment-headerelement.z-commentHeader row holding title and meta.
.z-comment-listelement.z-commentList of nested replies.
.z-comment-metaelement.z-commentSecondary meta line (date, actions).
.z-comment-primaryelement.z-commentHighlighted primary comment with tinted background.
.z-comment-titleelement.z-commentAuthor/title text.

Accessibility

  • Structure threads as lists; give avatars alt text or mark them decorative, and keep meta actions keyboard-reachable.