About this set
Two nested comment threads built from ordered lists inside ordered lists, so the reply structure is in the markup and not only in the indentation. The indented thread draws a rail down from each avatar and a curved connector into every reply, and each comment with replies has a button such as Hide 3 replies; pressing it hides the nested list, flips aria-expanded and changes the text to Show 3 replies. The compact thread is the dense, Reddit-like layout with small avatars and a Staff badge: the thread line itself is the collapse button, and once a branch is collapsed a visible Show replies button takes its place and receives focus. Reply opens an inline form under that comment, labelled Reply to and the author’s name, with Cancel and Esc returning focus to the Reply button. Posting adds your reply to the right list, creating it and its collapse control if needed, updates every reply count, moves focus to the new comment and announces Reply posted. Use the indented version for article comments and the compact one for busy product or community threads.
What’s included
- Nested ordered lists with rails and curved connectors drawn in CSS
- Collapse buttons with aria-expanded and live "n replies" counts
- Clickable thread lines in the compact variant
- Inline reply form that posts into the thread and creates new branches
- Esc and Cancel close the form and return focus to Reply
Accessibility
Replies are real nested lists, so screen readers announce the depth. Collapse controls are buttons with aria-expanded, aria-controls and text that says how many replies they hide; the thread-line button has visually hidden text. Reply buttons carry the author's name, the reply field is labelled, new replies receive focus and a polite status message, and every control has a 2px focus outline; transitions stop under prefers-reduced-motion.
Customise it
Change --tc-accent, --tc-rail and --tc-ind (the indent per level) on .tc. Bootstrap uses the same variables on the .card; in Tailwind edit the --color-tc-* theme colours and the [--tc-ind:28px] utility on each reply list.






