ScrollPremium

Progress Reveal Text

A 40 px word pinned to the top of its area fills with violet from left to right, through its letters, in step with scrolling: 0% at the top, 100% at the bottom (409 px of travel in the demo). One registered CSS property, --sb-progress, driven by animation-timeline: scroll(); a script of about fifteen lines takes over where the timeline is missing.

CSSJSProgressGradient

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Scroll has 74 effects, including 12 free. Explore the category →

3 usage examples

Headline of a long feature on salt harvesting — regional online magazine — Progress Reveal Text example 1

① Headline of a long feature on salt harvesting — regional online magazine

WhenA long article: the headline stays pinned under the magazine bar while you read, and colours in from the first paragraph to the last. At the end, the headline is full.
WhyThe headline does the job of a reading bar without adding anything to the page: it is already there, large, and its hard edge crossing the letters reads at a glance.
SettingsWord in Georgia 52 px, gradient colours changed (#16384a over #d6ccb8), word placed in a sticky band with a solid background (position: static on the word, width: fit-content so the gradient spans the word and not the line). 324 px area, 449 px of travel. Scrolling in the capture is driven by a demo script.
A bookshop's newsletter read on a phone — the words “LETTER READ” in the top bar fill in — Progress Reveal Text example 2

② A bookshop's newsletter read on a phone — the words “LETTER READ” in the top bar fill in

WhenIn the top bar of a mobile reading screen, a small pill carries two words in capitals. It turns green letter by letter as you move down the message.
WhyAt 10 px the fill stays readable because it crosses letters instead of relying on a 2 px bar; the pill says in words what is happening and doubles as a “read” state once full.
SettingsWord at 10 px, weight 800, letter-spacing .09em, green #17794f over grey #b9c4bd, inside a bordered pill. 306 px area in a phone frame, 501 px of travel. Capture scrolling driven by script.
Lyrics scrolling on a community karaoke screen — the song title fills in until the last verse — Progress Reveal Text example 3

③ Lyrics scrolling on a community karaoke screen — the song title fills in until the last verse

WhenOn a venue screen the lyrics rise on their own. The song title, very large above them, fills with yellow: once full, the song is over and the next table gets ready.
WhyHere the scrolling is automatic, and the effect follows it unchanged: it reads the position of the area, whoever moves it. The room sees how far along the song is without a counter.
SettingsWord at 35 px, weight 900, yellow #ffd447 over white at 24%, in a sticky band fading downwards. 322 px area, 333 px of travel; a script in the scene makes the lyrics rise, as the karaoke player would.

How it works

The word .sb-progress-text is transparent (-webkit-text-fill-color: transparent) and its background, cut to the shape of the letters by background-clip: text, is a gradient with two colours placed at the same spot: linear-gradient(90deg, #8b5cf6 var(--sb-progress), rgba(255,255,255,.15) var(--sb-progress)). Two stops on top of each other give a hard edge; that edge sits at --sb-progress of the word's width. The whole effect is about moving that percentage.

A percentage stored in a plain variable does not animate: the browser treats it as text and jumps from the first value to the last. The rule @property --sb-progress { syntax: '<percentage>'; inherits: false; initial-value: 0% } declares its type, so the fx0539ProgressFill animation (0% to 100%, linear, both) can interpolate it. animation-timeline: scroll() swaps the clock for the position of the nearest scrolling area, here .sdc-scroll-container (280 px tall; its 689 px of content set the travel at 409 px). Read in the demo: edge at 14.7% after 60 px scrolled, 34.2% at 140, 63.6% at 260, 100% at 409. Scrolling back up empties the word at the same pace.

The word is position: sticky; top: 16px: it stays in view while the subtitle and the four blocks pass underneath. Outside the animation, the base rule sets --sb-progress: 100%, so the word shows full whenever nothing drives it — an area too short to scroll (measured), a browser with neither the timeline nor the script. The supplied script only runs when CSS.supports('animation-timeline', 'scroll()') says no: it pauses the same animation and sets its currentTime on every scroll event, root by root. On Firefox 151 it yields the same percentages as the CSS path, to the hundredth.

Accessibility

  • Reading: the word is real text in a div, read as is whatever its fill. The fill itself is announced to nobody — no role="progressbar", no value. If it carries information (“you are halfway”), state it in plain text elsewhere.
  • Contrast: the unfilled part is white at 15% on #0a0a0f, that is 1.5:1 — at the top of the travel the word is guessed more than read. The filled part (#8b5cf6) reaches 4.7:1, enough for text this size. If the word must be readable on arrival, raise the gradient's base colour to about 45% white (4.5:1). The subtitle at 40% white sits at 3.8:1 for 12.5 px.
  • Keyboard: the scrolling area carries tabindex="0", role="region" and an aria-label to adapt: Tab stops on it in Chromium 149, Firefox 151 and WebKit 26.5, which skipped it before the attribute was added. The arrows then scroll it (down arrow: 40 px in Chromium, 51 px in Firefox; End: bottom of travel). On focus, the area gets a 2 px violet outline (#a78bfa) drawn inside it, from a :focus-visible rule you can recolour to your brand.
  • Reduced motion: a prefers-reduced-motion rule stops the “Scroll ↓” hint from blinking (it rests at 75% opacity) and turns off the area's smooth scrolling. The fill itself stays: it only moves under the reader's finger or wheel, never on its own (measured under emulation: 34.2% at 140 px, as without the rule). To freeze it anyway, add animation: none !important on .sb-progress-text inside that block: the word then shows full (the !important is for the fallback script, which writes an inline style).

Browser compatibility

Three building blocks: animation-timeline: scroll() (Chrome and Edge 115, Safari 26, Firefox 159 according to the MDN tables), @property (Chrome 85, Safari 16.4, Firefox 128) and background-clip: text, also written with the -webkit- prefix. Checked here: Chromium 149 and WebKit 26.5 in pure CSS, Firefox 151 through the script — same values in all three. Firefox 159 and later were not opened.

Chrome 115+✓ Full (measured, Chromium 149)
Edge 115+✓ Full according to the tables, not verified
Safari 26+✓ Full in the WebKit 26.5 test build; real Safari not verified
Safari 16.4 to 25✓ Through the fallback script — not verified
Firefox 128 to 158✓ Through the fallback script (measured, Firefox 151)
Firefox 159+✓ Pure CSS according to the tables — not verified

Without the timeline: the script replays the fill (it needs @property). With neither timeline nor script: the word is fully violet and still (measured, Firefox 151 without JavaScript). Without @property (Firefox before 128, Safari before 16.4): the percentage does not interpolate, the word would switch from empty to full in one go — not verified.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0539-root">
  <div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
    <div class="sb-progress-content">
      <div class="sb-progress-text">…</div>
      <div class="sb-progress-sub">…</div>
      <div class="sb-progress-blocks">
        <div class="sb-progress-block"></div>
        … ×4
      </div>
    </div>
  </div>
  <span class="sdc-scroll-hint" aria-hidden="true">…</span>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Colours (CSS — the two stops of the linear-gradient on .sb-progress-text) #8b5cf6 filled, white at 15% empty Change both colours and keep var(--sb-progress) on each. A 15% base leaves the word almost invisible at the start; at 45% it reads before being filled.
Edge (CSS — position of the second stop) hard (two stops at the same percentage) calc(var(--sb-progress) + 12%) on the second stop blends the boundary over 12% of the word (tried: the edge becomes a soft gradient).
Direction (CSS — gradient angle) 90deg, left to right 0deg fills from bottom to top, like a rising level (tried); 270deg starts from the right. On text spanning several lines, all lines advance together: the gradient covers the box, not each line.
Driving area (CSS — height and overflow-y on .sdc-scroll-container) the 280 px box Remove these two declarations: scroll() climbs up to the page and the word follows the window's scrolling (tried: 50% at mid-page). Keep it sticky then, or make it position: fixed.
Pinning (CSS — position: sticky; top: 16px) pinned 16 px from the top of the area Without sticky the word leaves with the content and exits the frame after about a hundred pixels. Inside a sticky band of your own, set it back to position: static.
Travel length (CSS — content of .sb-progress-content) 689 px of content, 409 px of travel The tray no longer has a fixed height: it follows whatever you put in it. Add blocks, or some bottom padding (padding-bottom), to stretch the fill. If everything fits in the area, there is no travel left and the word shows full.
Hint (HTML — span.sdc-scroll-hint) “Scroll ↓”, white, blinking between 50% and 85% opacity (5.3:1 at its faintest) A plain span placed at the bottom of the frame: delete it in a real page, its CSS rule then has nothing to style.

FAQ

Text Highlight Scroll splits a sentence into words and lights them one by one: a script counts the words, sets a class on those already passed, and the colour changes in steps. Here there is no splitting and no class: a single block of text, a gradient, and an edge that slides continuously, right through the middle of a letter if need be. One suits a paragraph read word by word, the other a word or headline used as a gauge. Not to be confused with Progress Reveal Steps (fx-0588), whose name is close but which colours no text: a thin bar follows the scrolling above step cards that rise one by one.
Because nothing is driving it, and the base rule then applies --sb-progress: 100%. Two usual causes: the content fits in the area (no travel, so no active timeline), or the word is not inside an element that scrolls. Give the parent a fixed height and overflow-y: auto, or let the page scroll.
Yes. Each .fx-0539-root follows its own area: with two copies, scrolling the second leaves the first untouched (measured, including with the fallback script, which attaches root by root). One precaution: @property registers --sb-progress for the whole document. If your stylesheet already uses that name with another type, rename it in the effect's CSS.