Liquid Glass CSS: Recreate Apple's iOS 26 Glass Effect on the Web

September 28, 2026  |  10 min read  |  CSS

By Syed · Frontend Engineer & Creator of UITweak

At WWDC in June 2025, Apple introduced Liquid Glass as the new design language for iOS 26: interface elements that behave like real glass, bending and refracting the content behind them. Within weeks, developers were trying to recreate it on the web. Here is the honest engineering picture: you can get about 80% of the way there with pure CSS, true refraction needs an SVG trick that only works in Chromium, and Safari needs a fallback. This guide covers all three, with copy-paste code.

Shortcut: dial in the base glass look visually in our free Glassmorphism Generator, then layer the Liquid Glass details from this guide on top.

1. What Makes Liquid Glass Different

Classic glassmorphism is a flat recipe: translucent background, backdrop-filter: blur(), a subtle border. Liquid Glass adds physics that glassmorphism never had:

  • Refraction: content behind the glass bends, like looking through a lens, instead of just blurring.
  • Specular highlights: bright edge lighting that shifts with the background, giving a curved-surface feel.
  • Depth response: the effect changes with what is behind the element, so the same component looks different over a photo versus a flat color.

Pure CSS cannot do real refraction. backdrop-filter can blur, saturate, and shift hue, but it cannot bend pixels. Keep that limit in mind and everything below will make sense.

2. The Pure CSS Recipe (Gets You 80% There)

This is the recipe that convincingly reads as Liquid Glass in every modern browser. Four layers do the work:

  1. backdrop-filter: blur(20px) saturate(180%)for the frosted base. The extra saturation is what makes colors feel "wet" instead of washed out.
  2. A translucent white gradient background (rgba(255,255,255,0.08) to rgba(255,255,255,0.02)) for the glass tint.
  3. inset box shadows: a bright top edge and a soft bottom inner shadow fake the curved-surface lighting.
  4. A 1px border with low-opacity white, brighter on the top edge via border-image or a pseudo-element.
.liquid-glass {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.03)
  );
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.18);
}

/* Specular sweep: the moving highlight that sells the effect */
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 48%,
    transparent 62%
  );
}

The ::before highlight is the detail most recreations miss. A static glass card looks flat; a soft diagonal sheen makes the surface read as curved. Animate its position on hover for the full effect.

3. True Refraction: The SVG Displacement Trick

To actually bend the background, you need feDisplacementMap: an SVG filter that distorts pixels based on a turbulence map. Combined with backdrop-filter, it produces genuine lens-like refraction.

<svg width="0" height="0" style="position:absolute">
  <filter id="liquid-refraction">
    <feTurbulence type="fractalNoise"
      baseFrequency="0.008 0.012" numOctaves="2" result="noise" />
    <feDisplacementMap in="SourceGraphic" in2="noise"
      scale="18" xChannelSelector="R" yChannelSelector="G" />
  </filter>
</svg>

<style>
  .liquid-refract {
    filter: url(#liquid-refraction);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
  }
</style>

The catch: applying SVG filters to HTML elements only works reliably in Chromium browsers. Firefox and Safari ignore filter: url() on HTML content. So this is a progressive enhancement, never the base experience. Ship the section 2 recipe as the default, then layer refraction on top inside @supports (filter: url(#x)) if you want to be careful, or just let unsupported browsers fall back gracefully since the filter is ignored silently.

4. Safari Fallbacks That Actually Work

Safari supports backdrop-filter but still needs the -webkit- prefix in some versions, and it is pickier about stacking contexts. Three rules:

  • Always declare -webkit-backdrop-filter before the unprefixed property, as in the code above.
  • Give the glass element its own stacking context (isolation: isolate or a transform) so the blur samples the right backdrop.
  • Provide a solid fallback inside @supports not (backdrop-filter: blur(1px)): a semi-opaque background color keeps the component usable where backdrop-filter is missing entirely.
.liquid-glass {
  isolation: isolate;
  background: rgba(30, 30, 40, 0.55); /* fallback */
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .liquid-glass {
    background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.12),
      rgba(255, 255, 255, 0.03));
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
  }
}

5. Liquid Glass vs Glassmorphism

The terms get mixed up constantly. Here is the practical difference:

  • Glassmorphism is a static style: frosted blur, subtle border, works everywhere, cheap to render. Best for cards, modals, and navbars that never change.
  • Liquid Glass is a behavior: refraction, specular light, response to the background. Best for hero elements, floating controls, and anywhere you want a premium, tactile feel.
  • Cost: Liquid Glass needs larger blur radii, extra pseudo-elements, and optionally SVG filters. It is measurably more expensive, so reserve it for a few focal elements, not every card on the page.
  • Compatibility: glassmorphism degrades gracefully everywhere. Liquid Glass refraction is Chromium-only; the CSS-only version works in all modern browsers.

6. Performance and Accessibility Notes

  • backdrop-filter is one of the most expensive CSS properties. Large blurred areas can drop frames on mid-range phones. Keep blur radii modest and avoid animating the filter itself.
  • Text over glass must stay readable. Check contrast against both light and dark backgrounds, since the backdrop changes the effective color.
  • Gate any animated sheen behind @media (prefers-reduced-motion: reduce) and provide a static version.

Start from a perfect glass base

Tune blur, saturation, tint, and borders on a live preview in our Glassmorphism Generator, then add the Liquid Glass details from this guide.

Open the Glassmorphism Generator, it's free

# Expansion draft: liquid-glass-css-guide

The Animated Sheen: Selling the Curve

The main guide's ::before highlight is static. The version that reads as liquid moves: a soft diagonal sheen that sweeps across the surface on hover, like light traveling over a curved lens. The implementation animates the pseudo-element's position, never the backdrop-filter itself:

.liquid-glass {
  position: relative;
  overflow: hidden; /* keep the sheen inside the rounded corners */
}

.liquid-glass::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgb(255 255 255 / 0.16) 50%,
    transparent 60%
  );
  transform: translateX(-60%);
  transition: transform 0.9s ease;
  pointer-events: none;
}

.liquid-glass:hover::before {
  transform: translateX(60%);
}

@media (prefers-reduced-motion: reduce) {
  .liquid-glass::before {
    transition: none;
    transform: none;
  }
}

The inset: -50% oversize is deliberate: it lets the gradient band travel fully across without its edges ever becoming visible mid-sweep. Animating transform keeps the motion on the compositor, which matters because the element underneath is already paying for a backdrop-filter. And the reduced-motion gate is not optional polish. A sweeping highlight is pure decoration, and users who ask for reduced motion should get the static glass, which still looks good.

Dark Mode Glass Is a Different Recipe

The main guide's recipe assumes a light backdrop: white tints, white borders, white speculars. Drop that component on a dark background and it turns to mud, because a white gradient at 12% opacity over near-black is barely visible, and the dark drop shadow disappears entirely.

Dark glass inverts the light logic. The tint becomes a dark translucent fill, the border stays light but thinner in effect, and the specular highlight gets brighter relative to the surface since it is now the main light source:

.liquid-glass-dark {
  background: linear-gradient(
    135deg,
    rgb(255 255 255 / 0.09),
    rgb(255 255 255 / 0.03)
  );
  border: 1px solid rgb(255 255 255 / 0.14);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 0.22),
    0 8px 32px rgb(0 0 0 / 0.45);
}

Note the drop shadow went darker and stronger (0.45 vs 0.18): on a dark page, elevation reads through deeper shadows, not lighter ones. I also drop saturation from 180% to 160% on dark backgrounds. Oversaturated blur over dark imagery gets neon fast, and the effect stops reading as glass. I keep both variants as separate classes rather than one class with media-query overrides, because most real products need glass on both themes simultaneously (a dark modal over a light page, or vice versa).

Glass Tokens: Themeable With Custom Properties

Two variants become six once marketing wants a tinted version for the hero. I tokenize the recipe so variants are one-line overrides:

.liquid-glass {
  --glass-blur: 20px;
  --glass-sat: 180%;
  --glass-tint-hi: rgb(255 255 255 / 0.12);
  --glass-tint-lo: rgb(255 255 255 / 0.03);
  --glass-border: rgb(255 255 255 / 0.25);

  background: linear-gradient(135deg, var(--glass-tint-hi), var(--glass-tint-lo));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}

.liquid-glass-brand {
  --glass-tint-hi: rgb(99 102 241 / 0.16);
  --glass-tint-lo: rgb(99 102 241 / 0.05);
  --glass-border: rgb(165 180 252 / 0.35);
}

Custom properties work inside backdrop-filter, so the blur and saturation are themable too. A frosted-heavy modal variant sets --glass-blur: 32px without duplicating the whole recipe. The rule I enforce: nobody writes a raw backdrop-filter value outside the token layer. The day Safari changes its blur rendering or the design team retunes the frost, there is exactly one place to edit.

Fading the Edges With mask-image

Hard glass edges look stuck-on when the component floats over photography. A soft edge fade melts the glass into the background, and mask-image does it without extra elements:

.glass-fade {
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

The mask applies to the element's whole rendering, backdrop blur included, so the frost itself dissolves rather than just the border. I use this on bottom-anchored glass sheets (the iOS-style floating tab bar look) where a hard bottom edge would cut visibly across the photo behind it. Two cautions: keep the fade zone outside interactive content, since a faded button looks disabled, and remember the -webkit- prefix, which Safari still needs for masks. A radial variant (radial-gradient(black 60%, transparent 100%)) gives the same treatment to floating glass orbs and notification pills.

Debugging: When the Glass Shows Nothing

The most common liquid-glass bug report is "it just looks like a translucent box," and the cause is almost always the backdrop, not the glass. backdrop-filter: blur(20px) over a flat solid background blurs nothing visible: blurring a single color returns the same color. The effect needs varied content behind it (a photo, a gradient, text) to have anything to refract. Test every glass component over a busy background first; if it only ever sits over flat gray, save the GPU cost and use a plain translucent fill.

The second cause is an opaque background. The recipe's gradient tints are translucent by design, but if a later rule or a utility class sets a solid background-color, it paints over the backdrop and the blur has nothing to show through. Inspect computed background in DevTools and confirm alpha values below 1.

The third is the filter being overridden entirely. Tailwind users hit this when a backdrop-blur utility and a custom class fight over the same property, or when !important utilities win. Computed styles settle it: if backdrop-filter shows none or a value you did not write, something downstream overrode the recipe. Glass debugging is always backdrop, background, then cascade, in that order.

Share this guide