Working in src/pages/styleguide

The public visual styleguide for danny.is (served at /styleguide). Reference for how everything renders.

Rules

Table of contents (per-page toc)

Each routed page defines a const toc = [{ id, label }, …] and passes it to StyleguideLayout, which renders a sticky sidebar. Highlighting-as-you-scroll is a CSS-only scroll-spy (scroll-target-group / :target-current) — experimental, Chrome 140+ only, and a pure progressive enhancement (it simply doesn’t highlight in other browsers).

When you add, remove, or reorder a major section heading on a page, update that page’s toc to match:

Directory structure

Each routed page is a top-level .astro file; underscore-prefixed directories are helpers and are not routed: