About this set
A sticky blog header with a 3px indigo bar along its bottom edge that fills from left to right as the reader scrolls through the page. It suits long articles, guides and documentation, where knowing how much is left helps. Where the browser supports scroll-driven animations, the bar is pure CSS: a keyframe that scales it from 0 to 1, attached to animation-timeline: scroll(root block), with no scroll listener at all. In other browsers a short script sets the bar’s width from a passive scroll listener instead. The bar is decorative and aria-hidden. It follows the scroll position and never moves on its own, so it stays on under reduced motion, while the link transitions switch off. Below 992px the three links fold behind a menu button. The Tailwind version defines the animation as a custom scroll-progress utility behind a supports-[…] variant.
What’s included
- Progress bar driven by animation-timeline: scroll()
- Script fallback only where scroll timelines are unsupported
- Decorative bar hidden from screen readers
- Menu button below 992px, closed with Esc
- Tailwind @utility for the scroll-driven animation
Accessibility
The bar is aria-hidden because it repeats what the scroll position already tells assistive technology. The links sit in a nav labelled Main with aria-current="page" on the current one. The menu button is a real button with an accessible name that reports aria-expanded; it opens with Enter or Space, and Esc closes the menu and returns focus to the button. Link transitions switch off under prefers-reduced-motion; the bar only moves when the reader scrolls.
Customise it
Change the 3px height and #4f46e5 on .pg-bar. In Tailwind edit h-[3px] and bg-[#4f46e5] on the bar and the pg-grow keyframes in the text/tailwindcss block.



















