Bearblog CSS: Table of Contents
anarchaeopteryx.bearblog.dev·12h
Flag this post
  • 2025-10-22 *

How to generate and insert a table of contents into your bearblog posts and some responsive styling for it.

A Table of Contents is one of the first things I made and styled when I started using Bearblog so I could insert it into my weekly digest posts. I have tweaked it a lot of times since then, and probably will continue to tweak it. It is simply a div with a header and a nested list.

The styling features:

  • Responsive margins and padding that makes the list more compact on smaller screen sizes.
  • Different markers for different levels of nested lists, e.g. 1. i. a.
  • Takes up about half the body width on wide screens, but takes up the whole width of the body on smaller screens (responsive margin-right...

Similar Posts

Loading similar posts...