Format Code Now
/
Web & markupCSS Glassmorphism Generator Next: Cubic Bezier Curve Generator ›

CSS Glassmorphism Generator

WM-112

Adjust the tint, blur, saturation, border and corners of a frosted glass panel over a test background and copy the CSS that draws it.

Runs in your browser. Nothing is uploaded.

Glass

#ffffff
%
px
%
%
px

Preview and CSS

backgroundrgba(255, 255, 255, 0.2)
backdrop-filterblur(12px) saturate(140%)
border1px solid rgba(255, 255, 255, 0.35)

CSS

.glass {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

How to use it

  1. Pick the tint color and how opaque it is.
  2. Set the blur and the saturation of what shows through.
  3. Adjust the border opacity, corner radius and shadow.
  4. Try the preview backgrounds, then press Copy.

How the glass effect is made

A glass panel has three parts: a translucent tinted background, a backdrop-filter that blurs and saturates whatever is behind the element, and a thin light border that catches the edge. The filter is written twice, once with the -webkit- prefix for Safari versions that need it. If blur is 0 and saturation is 100 percent, the filter is written as none.

Making it show up

Backdrop-filter only affects what is behind the element, so the effect needs a background with detail, such as an image or colorful shapes, and the panel must sit above that content. On a flat color it looks like a plain tinted box. The preview background is only a test backdrop and is not part of the CSS. Blur can be costly to draw on slow devices, so test on your targets.

Questions people ask

Why can I not see the blur on my page?

Backdrop-filter blurs the content behind the element. If the area behind it is a flat color there is nothing to blur. Put the panel over an image, gradient or text, and keep the panel on top.

Do I need the -webkit- line?

It is included for Safari versions that need the prefix. If you only support browsers where the unprefixed backdrop-filter works, you can delete that line, but keeping it does no harm.

What is the difference between filter and backdrop-filter?

filter changes the element itself and its content. backdrop-filter changes only what is painted behind the element, which is what makes the see-through frosted look.

Is glassmorphism bad for accessibility?

It can be, because text over a changing background has uneven contrast. Use a stronger tint, test text contrast against the busiest part of the background, and avoid thin, light text on glass.

Does it affect performance?

Blurring the backdrop takes work from the graphics hardware, so large blur values on big or animated panels can slow low-powered devices. Keep the blur moderate and the panel small where you can.

About this tool

Writes a translucent tinted background, a backdrop-filter that blurs and saturates whatever is behind the element, a thin light border, rounded corners and an optional shadow. The same filter is written twice, once with the -webkit- prefix for Safari versions that need it. The effect only shows when something with detail sits behind the element, and the element itself must be on top of that content. A blur of 0 with saturation at 100 percent writes none. The preview background is only a backdrop for testing and is not part of the CSS. Browser support and performance vary, so test on your target devices.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.