Table of Contents Web Component

Zach Leatherman · 2026年9月15日

…and another one.

This little (zero CSS) web component has two modes: progressively enhance a hierarchy of server rendered <ol> or <ul> elements (or conveniently client render them for you if they don’t exist) to highlight which are currently visible in the viewport.

I pulled this code out of the table-of-contents.webc component from the WebC Tugboat starter project for standalone use.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Zach Leatherman

Your Tools are Hiding npm Audits from You

Meaningful Audits are Important Look at these two npm audit outputs generated this morning and tell me which project is more secure: $ npm audit # uh… 521 lines of vulnerability reports truncated 78 vulnerabilities (7 low, 23 moderate, 46 h

All of my 300+ browser tabs are beautiful

I am a habitual tab hoarder so I created a Firefox addon to help me manage every one of my very special browser tabs. Sort tabs by oldest, unload them, find duplicates, and consolidate tabs to a single window — buncha useful stuff in there!

“AI, make the website good”

Millions of Large-Language-Model-generated words have been spilled on craftsmanship in this gilded-age of software development. We now have agents to plan how code will be written, agents to write code, agents to review code, agents to orch

Icon Fall Web Component

I’ve been doing some spring/fall cleaning and found an unpublished follow-up component to <snow-fall> (a web component to “snow” on your website — which also happens to work with emoji too). Originally it was created as an easter egg for Bl

Solar Eclipse Toggle Web Component (two state dark/light mode toggle)

In Trying out a Two-state Dark Mode Toggle I summarized the Two-state Dark and Light mode Toggle discussion as I experimented with a toggle in my personal website footer. After launch, Curtis Wilcox left some good feedback to improve the ac