How it works

One band of light, three ways to paint it

A shimmer is a soft band of light that crosses something every now and then. The band is always a linear-gradient. What differs is where it lives: on a layer over the content, inside the text itself, or in a mask that decides how much of the content shows.

1. sheen: a layer that slides

An aria-hidden layer the size of the box sits over the content with overflow: hidden and the box's border-radius. Inside it, a second layer carries the band: a gradient that is transparent except for a stripe in the middle. That inner layer moves with translate from −100% to 100% of its own width. At either end it is completely outside the clip, whatever the angle of the stripe, so the sweep starts and ends invisibly.

translate is the cheapest thing CSS can animate: the browser paints the band once and the compositor moves it. mix-blend-mode decides how the band meets the content. soft-light and overlay brighten what is already there and keep saturated buttons saturated; normal lays white on top and can wash out the label. The blend sits on the clipping layer, not the band: the band's own blend would only mix inside its parent's group.

2. text: background-clip

background-clip: text paints an element's background only where its text is, and -webkit-text-fill-color: transparent lets it show through. The background is the band on currentColor, so outside the band the text keeps exactly its own color. The band itself is the highlight mixed into the text color with color-mix().

3. mask: alpha only

mask-image uses the same kind of gradient, but only its alpha matters: black at reduced alpha outside the band, opaque black in it. Everything outside the band shows at reduced opacity, the band at full. That works for any content, and it is the right tool for skeleton loaders: the gaps between the placeholder blocks are transparent, so masking them changes nothing and only the blocks light up, all from one gradient across the whole card.

4. Moving the band inside a gradient

For text and mask the band has to move inside the gradient, since there is no layer to slide. Its position is a custom property registered as a <percentage>, used in the color stops, and animated. Registration is what lets the browser interpolate it (see the aurora page). The gradient line of a linear-gradient is sized so its 0% and 100% lines touch the box's far corners, for every angle, so a band centered at −half or 100% + half its width is fully outside.

Pause needs no extra keyframe. The sweep is one linear animation that starts further back, by exactly the distance the band would cover during the pause. It crosses the box at the same speed and spends the rest of the cycle out of sight. Currently: -600% → 100% in 3.5s.

This is the CSS for your current settings:

.shimmer { position: relative; isolation: isolate; }

/* box-sized layer over the content, clipped to it */
.sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.sheen > .band {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 41%, #ffffff, transparent 59%);
  opacity: 0.8;
  translate: -100% 0;
}

@media (prefers-reduced-motion: no-preference) {
  .shimmer .band {
    animation: slide 3.5s linear infinite;
  }
}

@keyframes slide {
  from { translate: -600% 0; }
  to { translate: 100% 0; }
}

Motion and accessibility

  • Under prefers-reduced-motion: reduce, and with Animate off, the content is shown plain: no band, no mask, normal text color. The Pause animations button freezes the band where it is (WCAG 2.2.2).
  • The text stays real text in every mode. The sheen layer is aria-hidden and ignores the pointer, so the button under it is still a normal button.
  • A skeleton is decoration. The demo puts it in a role="status" region with visually hidden text ("Loading profile…") and hides the blocks with aria-hidden, so a screen reader hears what is going on instead of nothing.
  • In text mode the band changes the text color. Keep Intensity moderate on light backgrounds, or the passing band can drop below readable contrast for a moment.

Browser support

CSS masks are Baseline widely available since 2026-06-07 and @property newly available since 2024-07-09, per web-features 3.44.0. background-clip: text is not Baseline yet; the component sets both the prefixed and the unprefixed property. The text and mask techniques check for CSS.registerProperty after mount and show the content plain where it is missing; sheen only animates translate and works everywhere. Tested in Chromium 156 only; Firefox and Safari are untested.

Performance notes

  • sheen is compositor-only. The band is painted once and moved by the GPU. Use it for anything that shimmers for a long time.
  • text and mask repaint every frame, because the gradient itself changes. For a headline or a few skeleton cards that is cheap; for long lists of skeleton rows, wrap the whole list in one shimmer instead of one per row (judgment).
  • Paused, reduced motion or between hover sweeps, nothing repaints.

Back to the demo ↑