All effectsVisual styles

Frosted Glass

毛玻璃

A translucent surface blurs what sits behind it while keeping its own contents sharp.

Look at the shapes behind the panel

Where to use it

Layer navigation, information panels, or overlays above an image or colored background. Choose the tint using the brightest and darkest areas that can pass under the panel, especially when it is fixed on screen.

Practical example

A trail guide keeps the next waypoint and estimated arrival time in a translucent bar over the map. Panning softens the roads behind the bar while the waypoint name stays sharp.

AI prompt

Add Frosted Glass to [target panel]. Use a translucent surface and backdrop blur so the content stays sharp while the backdrop softens. Set a solid fallback where backdrop filtering is unavailable and check text contrast against the lightest and darkest areas behind the panel.

Example code

Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.

View HTML
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Frosted Glass</title>
  <style>
    :root {
      color-scheme: dark;
      --demo-bg: #171629;
      --demo-ink: #f8f5ff;
      --demo-accent: #b9a6ff;
      --demo-muted: #bfbbd3;
      font-family: system-ui, sans-serif;
      color: var(--demo-ink);
      background: var(--demo-bg);
    }

    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; min-width: 0; }
    button, input { font: inherit; }

    .demo {
      display: grid;
      place-items: center;
      align-content: center;
      min-height: 100vh;
      padding: 14px;
      overflow: hidden;
      background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
    }

    .demo-button {
      border: 1px solid #ffffff3d;
      border-radius: 7px;
      background: #ffffff12;
      color: var(--demo-ink);
      padding: 6px 11px;
      font-size: 12px;
      cursor: pointer;
    }

    :focus-visible {
      outline: 2px solid var(--demo-accent);
      outline-offset: 3px;
    }

    .glass-scene {
      position: relative;
      display: grid;
      place-items: center;
      isolation: isolate;
      width: min(100%, 274px);
      min-height: 122px;
      overflow: hidden;
      border: 1px solid #53496d;
      border-radius: 17px;
      background: #25213b;
    }
    .glass-shape { position: absolute; z-index: -1; }
    .glass-orchid {
      width: 132px;
      height: 77px;
      left: 14%;
      top: 15%;
      border-radius: 17px;
      background: #a887ff repeating-linear-gradient(90deg, transparent 0 9px, #7e5dde 9px 10px);
      transform: rotate(-24deg);
    }
    .glass-peach { width: 79px; height: 79px; right: 17%; top: 9%; border-radius: 50%; background: #f3a48f; }
    .glass-mint { width: 110px; height: 56px; right: 8%; bottom: -2px; border-radius: 40px; background: #83dfdc; transform: rotate(-24deg); }
    .frosted-panel {
      padding: 20px clamp(12px, 7vw, 24px);
      border: 1px solid #ffffff83;
      border-radius: 12px;
      background: #29223995;
      backdrop-filter: blur(9px) saturate(135%);
      color: #fff;
      font-size: 14px;
      font-weight: 680;
    }
  </style>
</head>
<body>
  <main class="demo">
    <div class="glass-scene">
      <i class="glass-shape glass-orchid" aria-hidden="true"></i>
      <i class="glass-shape glass-peach" aria-hidden="true"></i>
      <i class="glass-shape glass-mint" aria-hidden="true"></i>
      <div class="frosted-panel">Control center</div>
    </div>
  </main>
</body>
</html>

Original example by UI Skills