demo · v142

Reading Progress Bar

The exact use case CSSWG editors cite for these pseudo-classes: a carousel / paginated reader where the markers themselves are the progress indicator. Read segments behind you turn green via :target-before, your current step is solid black via :target-current, upcoming steps stay neutral via :target-after. No JS-driven className shuffling needed in Chrome 142+.

:target-before (read) :target-current (you are here) :target-after (unread)
native :target-current
step
% read

Whichever rendering path runs, the same CSS selectors describe the styling intent. The polyfill applies .is-before/.is-current/.is-after with matching declarations.

relevant API

.progress-bar a:target-before  { background: green; }
.progress-bar a:target-current { background: black; }
.progress-bar a:target-after   { background: #eee;  }

see also