Tearsheet

Issue 01 · Content · p.32

Comment thread

A discussion with one level of replies, author badges, relative times and quiet actions.

Why it works: Nest replies only one level deep; deeper threads become unreadable on phones. The reply button says who you are replying to.

Try it:
Receipt: axe clean · contrast 5.35:1 · 4 tab stops · RTL ✓ · long text ✓

Tab order

  1. button "Reply to Rosa"
  2. button "Like · 4"
  3. button "Reply to Tomás"
  4. button "Like · 9"

What assistive tech is given

- region "Comments":
  - article:
    - paragraph:
      - text: Rosa K. Author
      - time: 2 days ago
    - paragraph: Should the toast stay on screen longer when it contains an Undo button?
    - paragraph:
      - button "Reply to Rosa"
      - button "Like · 4"
    - article:
      - paragraph:
        - text: Tomás M.
        - time: 1 day ago
      - paragraph: Yes. And pause the timer while it has focus or the pointer is over it, so nobody loses the undo.
      - paragraph:
        - button "Reply to Tomás"
        - button "Like · 9"

Automated checks in CI (axe in Chromium, reduced motion on). They catch a lot, not everything: still try it with a screen reader.

See it in the zine npx -y tearsheet add comment-thread

Needs the shared tokens.css once per project.

HTML + CSS

index.html
<!-- tearsheet comment-thread v2d1de446 · https://qusaialjbali.github.io/tearsheet/zine/parts/comment-thread.html -->
<section class="comments" aria-label="Comments">
  <article class="cmt">
    <span class="cmt-av" aria-hidden="true">RK</span>
    <div class="cmt-body">
      <p class="cmt-meta"><b>Rosa K.</b> <span class="cmt-badge">Author</span> <time datetime="2026-11-25">2 days ago</time></p>
      <p>Should the toast stay on screen longer when it contains an Undo button?</p>
      <p class="cmt-actions"><button type="button">Reply to Rosa</button><button type="button" aria-pressed="false">Like · 4</button></p>
      <article class="cmt reply">
        <span class="cmt-av alt" aria-hidden="true">TM</span>
        <div class="cmt-body">
          <p class="cmt-meta"><b>Tomás M.</b> <time datetime="2026-11-26">1 day ago</time></p>
          <p>Yes. And pause the timer while it has focus or the pointer is over it, so nobody loses the undo.</p>
          <p class="cmt-actions"><button type="button">Reply to Tomás</button><button type="button" aria-pressed="false">Like · 9</button></p>
        </div>
      </article>
    </div>
  </article>
</section>
styles.css
/* tearsheet comment-thread v2d1de446 · https://qusaialjbali.github.io/tearsheet/zine/parts/comment-thread.html */
.comments { width: 100%; max-width: 520px; }
.cmt { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.cmt.reply { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ui-border); }
.cmt-av { display: grid; place-items: center; width: 36px; height: 36px; font-size: 12px; font-weight: 700; color: #fff; background: #4f46e5; border-radius: 50%; }
.cmt-av.alt { background: #0f766e; }
.cmt-body > p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.cmt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px !important; color: var(--ui-muted); }
.cmt-meta b { color: var(--ui-text); }
.cmt-badge { padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--ui-accent); background: var(--ui-accent-soft); border-radius: 999px; }
.cmt-actions { display: flex; gap: 4px; }
.cmt-actions button { padding: 4px 8px; margin-left: -8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ui-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.cmt-actions button + button { margin-left: 0; }
.cmt-actions button:hover { color: var(--ui-text); background: var(--ui-surface-2); }
.cmt-actions button:focus-visible { outline: none; box-shadow: var(--ui-focus); }

React

CommentThread.jsx
/* tearsheet comment-thread v2d1de446 · https://qusaialjbali.github.io/tearsheet/zine/parts/comment-thread.html */
import './CommentThread.css';

export function CommentThread() {
  return (
    <section className="comments" aria-label="Comments">
      <article className="cmt">
        <span className="cmt-av" aria-hidden="true">RK</span>
        <div className="cmt-body">
          <p className="cmt-meta"><b>Rosa K.</b> <span className="cmt-badge">Author</span> <time dateTime="2026-11-25">2 days ago</time></p>
          <p>Should the toast stay on screen longer when it contains an Undo button?</p>
          <p className="cmt-actions"><button type="button">Reply to Rosa</button><button type="button" aria-pressed="false">Like · 4</button></p>
          <article className="cmt reply">
            <span className="cmt-av alt" aria-hidden="true">TM</span>
            <div className="cmt-body">
              <p className="cmt-meta"><b>Tomás M.</b> <time dateTime="2026-11-26">1 day ago</time></p>
              <p>Yes. And pause the timer while it has focus or the pointer is over it, so nobody loses the undo.</p>
              <p className="cmt-actions"><button type="button">Reply to Tomás</button><button type="button" aria-pressed="false">Like · 9</button></p>
            </div>
          </article>
        </div>
      </article>
    </section>
  );
}
CommentThread.css
/* tearsheet comment-thread v2d1de446 · https://qusaialjbali.github.io/tearsheet/zine/parts/comment-thread.html */
.comments { width: 100%; max-width: 520px; }
.cmt { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.cmt.reply { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ui-border); }
.cmt-av { display: grid; place-items: center; width: 36px; height: 36px; font-size: 12px; font-weight: 700; color: #fff; background: #4f46e5; border-radius: 50%; }
.cmt-av.alt { background: #0f766e; }
.cmt-body > p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.cmt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px !important; color: var(--ui-muted); }
.cmt-meta b { color: var(--ui-text); }
.cmt-badge { padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--ui-accent); background: var(--ui-accent-soft); border-radius: 999px; }
.cmt-actions { display: flex; gap: 4px; }
.cmt-actions button { padding: 4px 8px; margin-left: -8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ui-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.cmt-actions button + button { margin-left: 0; }
.cmt-actions button:hover { color: var(--ui-text); background: var(--ui-surface-2); }
.cmt-actions button:focus-visible { outline: none; box-shadow: var(--ui-focus); }

Vue

CommentThread.vue
<!-- tearsheet comment-thread v2d1de446 · https://qusaialjbali.github.io/tearsheet/zine/parts/comment-thread.html -->
<template>
  <section class="comments" aria-label="Comments">
    <article class="cmt">
      <span class="cmt-av" aria-hidden="true">RK</span>
      <div class="cmt-body">
        <p class="cmt-meta"><b>Rosa K.</b> <span class="cmt-badge">Author</span> <time datetime="2026-11-25">2 days ago</time></p>
        <p>Should the toast stay on screen longer when it contains an Undo button?</p>
        <p class="cmt-actions"><button type="button">Reply to Rosa</button><button type="button" aria-pressed="false">Like · 4</button></p>
        <article class="cmt reply">
          <span class="cmt-av alt" aria-hidden="true">TM</span>
          <div class="cmt-body">
            <p class="cmt-meta"><b>Tomás M.</b> <time datetime="2026-11-26">1 day ago</time></p>
            <p>Yes. And pause the timer while it has focus or the pointer is over it, so nobody loses the undo.</p>
            <p class="cmt-actions"><button type="button">Reply to Tomás</button><button type="button" aria-pressed="false">Like · 9</button></p>
          </div>
        </article>
      </div>
    </article>
  </section>
</template>

<style scoped>
.comments { width: 100%; max-width: 520px; }
.cmt { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.cmt.reply { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ui-border); }
.cmt-av { display: grid; place-items: center; width: 36px; height: 36px; font-size: 12px; font-weight: 700; color: #fff; background: #4f46e5; border-radius: 50%; }
.cmt-av.alt { background: #0f766e; }
.cmt-body > p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.cmt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px !important; color: var(--ui-muted); }
.cmt-meta b { color: var(--ui-text); }
.cmt-badge { padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--ui-accent); background: var(--ui-accent-soft); border-radius: 999px; }
.cmt-actions { display: flex; gap: 4px; }
.cmt-actions button { padding: 4px 8px; margin-left: -8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ui-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.cmt-actions button + button { margin-left: 0; }
.cmt-actions button:hover { color: var(--ui-text); background: var(--ui-surface-2); }
.cmt-actions button:focus-visible { outline: none; box-shadow: var(--ui-focus); }
</style>

Svelte

CommentThread.svelte
<!-- tearsheet comment-thread v2d1de446 · https://qusaialjbali.github.io/tearsheet/zine/parts/comment-thread.html -->
<section class="comments" aria-label="Comments">
  <article class="cmt">
    <span class="cmt-av" aria-hidden="true">RK</span>
    <div class="cmt-body">
      <p class="cmt-meta"><b>Rosa K.</b> <span class="cmt-badge">Author</span> <time datetime="2026-11-25">2 days ago</time></p>
      <p>Should the toast stay on screen longer when it contains an Undo button?</p>
      <p class="cmt-actions"><button type="button">Reply to Rosa</button><button type="button" aria-pressed="false">Like · 4</button></p>
      <article class="cmt reply">
        <span class="cmt-av alt" aria-hidden="true">TM</span>
        <div class="cmt-body">
          <p class="cmt-meta"><b>Tomás M.</b> <time datetime="2026-11-26">1 day ago</time></p>
          <p>Yes. And pause the timer while it has focus or the pointer is over it, so nobody loses the undo.</p>
          <p class="cmt-actions"><button type="button">Reply to Tomás</button><button type="button" aria-pressed="false">Like · 9</button></p>
        </div>
      </article>
    </div>
  </article>
</section>

<style>
.comments { width: 100%; max-width: 520px; }
.cmt { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.cmt.reply { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ui-border); }
.cmt-av { display: grid; place-items: center; width: 36px; height: 36px; font-size: 12px; font-weight: 700; color: #fff; background: #4f46e5; border-radius: 50%; }
.cmt-av.alt { background: #0f766e; }
.cmt-body > p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.cmt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px !important; color: var(--ui-muted); }
.cmt-meta b { color: var(--ui-text); }
.cmt-badge { padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--ui-accent); background: var(--ui-accent-soft); border-radius: 999px; }
.cmt-actions { display: flex; gap: 4px; }
.cmt-actions button { padding: 4px 8px; margin-left: -8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ui-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.cmt-actions button + button { margin-left: 0; }
.cmt-actions button:hover { color: var(--ui-text); background: var(--ui-surface-2); }
.cmt-actions button:focus-visible { outline: none; box-shadow: var(--ui-focus); }
</style>