Scroll-driven progress bar

Open in editor
body { margin: 0; font: 17px/1.7 Georgia, serif; background: #fbfaf7; color: #16171a; }
article { max-width: 620px; margin: 0 auto; padding: 60px 20px; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 5px; background: #3f6b00; transform-origin: left; transform: scaleX(.15); }
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

Usage

Supported in Chromium 115+ and Safari 26+. Falls back to a static bar elsewhere.