Glassmorphism With CSS backdrop-filter: How It Works and When to Use It
Frosted glass panels, where the background shows through blurred and softened, have been a staple of operating system design since Apple introduced translucency in iOS 7 (2013) and Microsoft followed with its Acrylic material in Fluent Design (2017). In 2020 the style got a name on the web, “glassmorphism”, and Apple pushed translucent materials further again with its “Liquid Glass” design in 2025. The good news is that the core effect takes only a few lines of CSS.
The ingredients
A convincing glass panel has four parts:
- A semi-transparent background, so the content behind is visible.
- A background blur, which frosts whatever is behind the panel.
- A subtle light border, which mimics light catching the edge of glass.
- A soft shadow, which lifts the panel off the background.
.glass {
background: rgb(255 255 255 / 0.22);
backdrop-filter: blur(14px) saturate(160%);
-webkit-backdrop-filter: blur(14px) saturate(160%);
border: 1px solid rgb(255 255 255 / 0.35);
border-radius: 20px;
box-shadow: 0 8px 32px rgb(20 20 20 / 0.12);
}backdrop-filter versus filter
These two properties are easy to confuse:
| Property | What it affects | Example result |
|---|---|---|
filter: blur(10px) | The element itself and its children | The panel and its text become blurry |
backdrop-filter: blur(10px) | Whatever is behind the element | The panel stays sharp; the background seen through it is blurred |
backdrop-filter is what makes glass possible. It accepts the same functions as filter: blur, saturate, brightness, contrast and more. Adding saturate(150–180%) is a small detail that makes colors behind the glass look richer, closer to how real frosted glass glows.
Safari needs the -webkit-backdrop-filter prefix (unprefixed support arrived only in recent versions), so keep both lines. Chrome, Edge and Firefox support the unprefixed property; Firefox enabled it by default in version 103 (2022).
It needs something behind it
The most common glassmorphism mistake is putting a glass panel on a plain white or flat grey background. With nothing colorful behind it, the blur has nothing to blur, and the panel just looks like a slightly grey box. Glass works over:
- vivid gradients or mesh gradients,
- photos,
- colorful shapes or blobs placed behind the panel,
- moving content, like a video or a scrolling page under a sticky header.
Readability: the big risk
Because the background changes depending on what is behind the panel, the contrast between text and its surroundings is unpredictable. A white glass panel with dark text might pass contrast over a dark area of the background and fail over a bright yellow area.
Ways to keep it readable:
- Increase background opacity where text sits. 30–60% white is much safer than 10–20%.
- Use stronger blur. More blur averages the background into a smoother color, so contrast becomes more predictable.
- Test the worst case. Check text against the lightest and darkest colors that could appear behind it using a contrast checker.
- Respect user preferences. Some systems offer a “reduce transparency” setting. CSS has a
prefers-reduced-transparencymedia query, but browser support is still incomplete, so make your default glass readable on its own.
What backdrop-filter costs the browser
backdrop-filter is one of the more expensive CSS effects. For every frame, the browser has to read the pixels behind the element and blur them, and the cost grows with the blur radius and the panel’s size. On modern desktops this is rarely an issue. On low-end phones, several large blurred panels, especially over animated or scrolling content, can cause dropped frames.
| Usage | Risk |
|---|---|
| One sticky header with blur | Low, very common pattern |
| A few small glass cards on a static background | Low |
| Full-screen glass overlays on scrolling content | Medium |
| Many stacked, large, heavily blurred layers with animation | High on mobile |
Keep blur radii moderate (8–20px), limit the number of glass layers on screen, and test on a mid-range phone.
Fallbacks
Always define a background that works without the blur, then enhance:
.glass { background: rgb(255 255 255 / 0.85); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
.glass { background: rgb(255 255 255 / 0.22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
}Browsers without support get a solid, readable panel instead of a transparent one.
Glass, neumorphism and flat design compared
| Style | Separation from background | Accessibility risk | Performance cost | Best for |
|---|---|---|---|---|
| Flat with borders | Borders and color | Low | Lowest | Most interfaces |
| Material elevation | Shadows | Low | Low | Apps, dashboards |
| Glassmorphism | Blur and transparency | Medium (variable contrast) | Medium | Overlays, headers, hero sections |
| Neumorphism | Soft paired shadows | High (low contrast) | Low | Decorative elements |
We look at the soft-shadow alternative in our neumorphism guide.
Where glass works well
- Sticky navigation bars, where content scrolls underneath and stays faintly visible.
- Modal and sheet overlays, which keep users oriented by showing the page behind.
- Media players and image overlays, where controls sit on top of video or photos.
- Hero sections with a single glass card on a vivid background.
Where it works less well: dense data tables, long-form reading, and forms, where clarity matters more than atmosphere.