CSS glassmorphism: the frosted-glass effect
Glassmorphism makes a panel look like a sheet of frosted glass: a translucent background, a blur of whatever is behind it, a thin light border and a soft shadow. The blur is the part that needs CSS support: the backdrop-filter property applies a filter to the area behind the element, not to the element itself. The generator writes the five declarations together, with the -webkit- prefix for Safari, and lets you tune each of them with a live preview. This page opens it on the "frost" preset.
A real result
background: rgba(255, 255, 255, 0.25);
border-radius: 16px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(12px) saturate(160%);
-webkit-backdrop-filter: blur(12px) saturate(160%);
border: 1px solid rgba(255, 255, 255, 0.3);The same effect as Tailwind classes:
bg-[rgba(255,255,255,0.25)] backdrop-blur-[12px] backdrop-saturate-[160%] rounded-[16px] border border-[rgba(255,255,255,0.3)] shadow-[0_4px_30px_rgba(0,0,0,0.1)]The four presets
| Preset | Color | Opacity | Blur | Saturation | Radius |
|---|---|---|---|---|---|
| frost | #ffffff | 25% | 12px | 160% | 16px |
| smoke | #141413 | 45% | 16px | 140% | 20px |
| tint | #3b82f6 | 30% | 10px | 180% | 12px |
| clear | #ffffff | 8% | 4px | 100% | 24px |
The dark "smoke" preset, for light backgrounds:
background: rgba(20, 20, 19, 0.45);
border-radius: 20px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
backdrop-filter: blur(16px) saturate(140%);
-webkit-backdrop-filter: blur(16px) saturate(140%);
border: 1px solid rgba(20, 20, 19, 0.15);What each part does
- background with alpha: the translucent tint. Too opaque and the blur cannot show; too transparent and the text loses its base.
- backdrop-filter: blur() saturate(): the blur softens the shapes behind; the saturation brings back the color that the blur washes out.
- The 1px border in a lighter tone: it simulates the edge of the glass catching light.
- box-shadow: lifts the panel from the background so that it does not look pasted on.
Common mistakes
- Putting it over a flat background: there is nothing to blur, so the effect disappears. Glass needs a colorful or detailed image or gradient behind it.
- Text that is hard to read: contrast changes as the background moves behind the glass. Test the text against the lightest and the darkest areas, and aim for 4.5:1.
- Applying it to many large elements: backdrop-filter is costly for the GPU, especially on phones. Use it on one or two panels, and keep the blur radius moderate.
- Having no fallback: when backdrop-filter is not supported the panel is just translucent. Wrap a more opaque background in @supports not (backdrop-filter: blur(1px)).
How to use the generator
- Pick a preset (frost, smoke, tint, clear) or set the color and opacity.
- Adjust blur, saturation, radius, border and shadow while watching the preview over a colorful background.
- Copy the CSS or the Tailwind classes.
Frequently asked questions
How do I make a frosted glass effect in CSS?
Give the element a semi-transparent background and backdrop-filter: blur(12px), plus a light 1px border and a soft shadow. The generator writes all of it for you.
Does backdrop-filter work in all browsers?
In current Chrome, Edge, Safari and Firefox. Older Safari versions need the -webkit-backdrop-filter prefix, which the generator always includes.
Why does my glass not blur the background?
Common causes: a solid background behind it, an ancestor with its own backdrop-filter or opacity that isolates the layer, or a background color so opaque that it covers the effect.