Implementing iOS Progressive Blur on the Web

Dec 06, 2026

When you scroll an iOS 27 app, the content blurs more and more as it slides under the top bar. It dissolves without a visible edge, so the clock overlapping the text doesn’t get in the way.

Progressive blur in an iOS app
Progressive blur in an iOS app

A blur whose strength changes by position like this is called a progressive blur. Let’s build something similar on the web with several layers of backdrop-filter.

A Single Blur Layer

This blog covers its top edge with a single blur layer.

styles/global.css
.blur-layer {
  position: fixed;
  top: 0;
  height: 96px;
  pointer-events: none;
  backdrop-filter: blur(5px);
  mask-image: linear-gradient(to bottom, #000000 25%, transparent);

  &:after {
    position: absolute;
    inset: 0;
    content: '';
    background: linear-gradient(to bottom, var(--page-background), transparent);
  }
}
css

The mask fades out the bottom of the blur, and a background gradient on top lets the text disappear smoothly. However, the mask only changes opacity, and the blur radius stays at 5px everywhere. So instead of blurring gradually, the edge shows a blurred view and a sharp view overlapping semi-transparently.

Stacking Blur Layers

CSS has no way to set a blur radius as a gradient, so you have to stack several blur layers. The layers below follow the measurements in the blur package in web-kits, which reads the layer tree in the iOS Simulator and fits the values to screenshots, and stack up in three steps.

1. Lay Down the Background Color

Before any blur, a semi-transparent layer of the page background color washes out the content. Laying it first lets the blurs stacked above also spread the background color.

const layers = [];

layers.push({
  background: 'var(--page-background)',
  // m is the mask strength at each position: 1 at the top of the band, fading to 0 below
  alpha: (m) => 0.5 * m,
});
js

2. Stack Four Small Blurs

Four blurs with small radii keep the text outlines while blurring more toward the top.

// Measured [m, px] pairs: radius needed at mask strength m
const RADIUS = [
  [0, 0],
  [0.025, 0.37],
  [0.05, 0.5],
  [0.1, 0.6],
  [0.2, 0.84],
  [0.3, 1.08],
  [0.4, 1.26],
  [0.5, 1.42],
  [0.6, 1.61],
  [0.7, 1.95],
  [0.8, 2.27],
  [0.9, 2.56],
  [1, 2.88],
];

function radiusAt(m) {
  const i = RADIUS.findIndex(([x]) => x >= m) || 1;
  const [m0, r0] = RADIUS[i - 1];
  const [m1, r1] = RADIUS[i];
  return r0 + ((r1 - r0) * (m - m0)) / (m1 - m0);
}

const most = 2.88;

for (let i = 0; i < 4; i++) {
  const from = (most * i) / 4;
  const to = (most * (i + 1)) / 4;

  layers.push({
    // Overlapping Gaussian blurs add their variances (σ²): 3px + 4px = 5px
    // So the radius that takes the blur stacked up to `from` to `to` is √(to² - from²)
    backdrop: `blur(${Math.sqrt(to ** 2 - from ** 2)}px)`,
    alpha: (m) => Math.min(1, Math.max(0, (radiusAt(m) - from) / (to - from))),
  });
}
js

3. Smooth Out Light and Dark With a Large Blur

A blur with a large radius is stacked with lighten and darken, lifting dark areas and pulling light areas down. Outlines stay, and only the light-dark difference shrinks.

const large = 'blur(29.6px)';

// Only Safari applies mix-blend-mode to backdrop-filter layers
const ua = navigator.userAgent;
const isSafari = ua.includes('AppleWebKit') && !/Chrome|Android/.test(ua);

if (isSafari) {
  layers.push(
    { backdrop: large, alpha: (m) => 0.25 * m },
    { backdrop: large, blend: 'lighten', alpha: (m) => 0.6 * m },
    { backdrop: large, blend: 'darken', alpha: (m) => 0.4 * m },
  );
} else {
  // Other browsers ignore the blend mode, so draw one layer at the average strength of the three
  // (Chrome can use an SVG filter with feBlend instead)
  layers.push({
    backdrop: large,
    alpha: (m) => 0.25 * m + 0.5 * m * (1 - 0.25 * m),
  });
}
js

Result

All three steps follow the same mask and fade out together toward the bottom, so the content blurs without a visible edge as it slides under the top bar.

You can find the full code in the demo source.

Wrapping Up

A few more layers make the top edge feel much closer to iOS.