CSS Glassmorphism Generator
Design a frosted-glass panel with blur, tint, border and corner controls, and copy the backdrop-filter CSS.
Presets
Preview
Glass panel
Shapes behind this panel are blurred. Text on glass has to stay readable over every colour underneath.
CSS
.glass {
background-color: rgba(255, 255, 255, 0.25);
-webkit-backdrop-filter: blur(12px) saturate(140%);
backdrop-filter: blur(12px) saturate(140%);
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 16px;
box-shadow: 0px 8px 32px 0px rgba(17, 24, 39, 0.15);
}
/* Without backdrop-filter there is no blur, so use a more opaque background. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
.glass {
background-color: rgba(255, 255, 255, 0.85);
}
}Browsers without backdrop-filter can’t blur, so when the tint is under 85% opacity the CSS ends with an @supports block that makes the panel 85% opaque there instead. Safari before version 18 only knows the -webkit- prefixed property, which is why both lines are included. Rename .glass to suit your own class.
Make a frosted-glass panel in CSS
Glassmorphism is the see-through, blurred panel you’ve seen in macOS menus, Windows 11 and a thousand Dribbble shots. In CSS it comes down to one property, backdrop-filter, which blurs whatever sits behind an element, plus a thin tint, a faint border and rounded corners.
Move the sliders and the panel in the preview updates at once over a colourful background, because blur is invisible over a flat colour. The CSS underneath is exactly what the preview uses, including the -webkit- line older Safari versions need and a fallback for browsers that can’t blur at all.
How to build the glass effect
- Start from a preset: Frosted (the default), Clear, Milky or Dark glass.
- Set the blur (0 to 40 px) and, if you like, the saturation. Above 100% the colours behind the glass get richer, which is the look Apple uses.
- Pick a tint colour and its opacity. White at 15 to 30% gives light glass; a dark navy at around 50% gives dark glass.
- Adjust the border, corner radius and shadow strength. Setting the border width or shadow to 0 removes that line from the CSS.
- Try the other preview backgrounds and set the text colour you’ll use. The line under the preview estimates the text contrast at the weakest spot.
- Click Copy CSS and rename .glass to your own class.
Where frosted glass works
- Over a photo or illustration: a hero image with a caption card, or a login box over a blurred brand image.
- Navigation that floats: a sticky header or a mobile tab bar, where the blur hints at the content scrolling underneath.
- Small overlays: tooltips, menus and media controls on top of video.
When glass looks bad
- Nothing behind it: over a plain white page, glass is just a pale grey box. It needs colour or detail behind it to show.
- Glass on glass: stacked translucent panels turn into mud and multiply the rendering cost.
- Too little tint: below about 10%, busy backgrounds show through and thin text becomes hard to read.
- Respect reduced transparency: people who switch on “reduce transparency” in their system settings can be given a solid panel with @media (prefers-reduced-transparency: reduce). Chromium-based browsers support that query so far.
Things to know before you ship glass
What backdrop-filter costs
To blur the backdrop, the browser has to paint everything behind the element, then run the blur over that area. If the content behind changes, as it does under a sticky header while the page scrolls, that work happens again on every frame.
The cost grows with the size of the glass and the blur radius. A small card over a still background is cheap. A full-screen overlay with a 40 px blur over a scrolling feed can make a mid-range Android phone stutter. Keep large glass areas to a modest blur, don’t animate the blur amount, and test on a real phone rather than a fast laptop.
Keeping text readable on glass
Text on glass sits on top of whatever is behind it, and that changes. White text that reads well over a dark photo can vanish when a light part of the page scrolls underneath.
The tint does most of the work. More opacity means a calmer, more predictable background for the text, so don’t be afraid to go to 40 or 60%. The contrast estimate here samples the preview background’s colours and their blends through your tint; for your real page, check the lightest and darkest spot in the Color Contrast Checker.
Browser support and the fallback
Chrome, Edge, Firefox (since version 103 in 2022) and Safari all support backdrop-filter today. Safari only accepted the unprefixed name from version 18 in 2024; before that it needed -webkit-backdrop-filter, and older iPhones still run those versions. That’s why the CSS has both lines, prefixed first.
A browser without support simply ignores the property, leaving a thin, unblurred tint that can make text hard to read. The @supports not (…) block catches exactly that case and raises the tint to 85% opacity. It’s left out when your tint is already 85% or more, or when there’s no filter.
CSS Glassmorphism Generator: common questions
Why doesn’t the blur show on my site?
Usually because there’s nothing interesting behind the element, or its background is fully opaque. Check that the tint opacity is below 100% and that something colourful sits behind the panel. In Chromium-based browsers, a parent with its own filter, opacity below 1 or backdrop-filter also limits the blur to what’s inside that parent.
Do I still need -webkit-backdrop-filter?
For now, yes, if you care about iPhones that haven’t been updated to iOS 18. Safari before version 18 ignores the unprefixed property. The extra line costs nothing in other browsers, which skip it.
Is glassmorphism bad for performance?
It can be, on large areas. A small blurred card is fine on almost anything. A full-screen blurred layer over moving content is one of the more expensive things you can ask a phone’s graphics chip to do, so give big glass areas a modest blur and test on a mid-range device.
What’s the difference between backdrop-filter and filter: blur()?
filter: blur() blurs the element itself, text included. backdrop-filter blurs only what’s behind the element and leaves its own content sharp, which is what makes text on glass readable. For softer edges without any blur, try the CSS Box Shadow Generator; for the colourful background itself, the CSS Gradient Generator.

