About this set
Three tree views built only from nested lists and the details and summary elements, with no JavaScript at all. Straight connectors shows a project folder in a monospace face with right-angled elbow lines and a rotating chevron. Rounded connectors, plus and minus draws a dental practice site map with curved elbows and a boxed plus that turns into a minus when the branch opens. Dotted guides with page numbers lays out a field guide’s contents with dotted rails and a dotted leader to each page number. Use the first for code and file structures, the second for site maps and category lists, and the third for tables of contents. Every nested list item draws its own connector: a ::before pseudo-element is the vertical rail and an ::after pseudo-element is the elbow, and the last child stops its rail at the elbow so no line hangs below the final item. Because the branches are native details elements, the browser handles opening, closing and keyboard access, and the tree still reads as a nested list when the CSS fails to load.
What’s included
- Three connector styles: straight, rounded with plus and minus, dotted with page numbers
- No JavaScript: native details and summary for every branch
- Connector lines drawn with ::before and ::after, last child trimmed
- Indent, row height, line style and corner radius set by custom properties
- Plain CSS, Bootstrap 5 and Tailwind CSS 4 versions of the same design
Accessibility
Each branch is a summary element, so it is announced as an expandable button with its open or closed state, and Tab, Enter and Space work without any script. Summaries show a 2px teal outline on keyboard focus. Text and the grey page numbers meet 4.5:1, and the chevron rotation is switched off under prefers-reduced-motion.
Customise it
Change --dt-line, --dt-accent, --dt-text and --dt-hover on .dt for colour, and --dt-row, --dt-indent, --dt-radius and --dt-style for row height, indent, elbow rounding and solid or dotted lines. The same variables drive the Bootstrap and Tailwind versions.






