← All posts

Frosted Glass with backdrop-filter

Apr 28, 2026#CSS140 words · 1 min read阅读中文原文 ↗

The short version

One line of CSS and your cards feel like macOS.

TestedCSS

The core CSS

.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

Three parts do the work:

  1. A translucent background — without it, nothing shows through
  2. blur — the frosting itself
  3. saturate — boosts the colors behind the element, imitating the way glass refracts light

Browser support

Browser Support
Chrome 76+
Safari 9+ needs the -webkit- prefix
Firefox 103+

Performance caveat

backdrop-filter promotes the element to a GPU compositing layer, so don’t scatter it across large areas or scrolling will drop frames. Where it belongs: navbars, cards, modals.

Going further: a noise overlay

Plain frosted glass looks a little plastic. A layer of SVG noise on top reads as more “real”:

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/noise.svg');
  opacity: 0.04;
  pointer-events: none;
}
Was this useful?

If this post helped, you can buy me a coffee ☕