CSS Glassmorphism: 16 Examples + the 3-Line Recipe

Almost nobody used backdrop-filter in 2018, when Chromium engineer Mason Freed put unprefixed usage at about 0.0003% on a W3C mailing list. Chrome Platform Status now counts it on about 37% of page loads.

Below are 16 CSS glassmorphism examples you can try and copy, followed by a guide to blur values, backdrops, browser support, contrast and performance.

By Bogdan Sandu · Updated October 28, 2026

Glass cards over photographs

Photos show the frost best and make contrast hardest. Each panel carries a tint dark or light enough for its text to pass 4.5:1 over the worst spot of the image, and swaps to a near-opaque fill when backdrop-filter is missing or the user asks for less transparency.

Sign-in card on a photo

  • backdrop-filter
  • dark tint layer
  • @supports not

A dark green tint at 0.58 alpha sits between the waterfall and the white text, so even the brightest spray keeps the labels above 4.5:1. The inputs are glass too, with a lighter fill and a 50% white border that stays above 3:1 against the card. The show button flips the field type and reports its state with aria-pressed.

View code
.gl-login {
  display: grid;
  place-items: center;
  min-height: 500px;
  padding: 40px 16px;
  background: #1f3a2a url("forest-waterfall.webp") center / cover no-repeat;
}
.gl-login__card {
  display: grid;
  width: min(100%, 340px);
  padding: 28px 24px 22px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 22px;
  background: rgba(8, 24, 16, .58);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .3);
  color: #fff;
}
.gl-login__title {
  margin: 0 0 4px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
  color: #fff;
}
.gl-login__sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: #e3efe7;
}
.gl-login__label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.gl-login__input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  margin: 0 0 14px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: inherit;
  font-size: 15px;
}
.gl-login__input::placeholder {
  color: #d3e2d8;
  opacity: 1;
}
.gl-login__pass {
  position: relative;
}
.gl-login__pass .gl-login__input {
  padding-right: 74px;
}
.gl-login__show {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 56px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.gl-login__show[aria-pressed="true"] {
  background: #fff;
  color: #0e2a1c;
}
.gl-login__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 13px;
}
.gl-login__check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}
.gl-login__check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #9be8b9;
}
.gl-login__forgot {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.gl-login__submit {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #eef8f1;
  color: #0e2a1c;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease;
}
.gl-login__submit:hover {
  background: #fff;
}
.gl-login__status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: #e3efe7;
}
.gl-login__input:focus-visible,
.gl-login__show:focus-visible,
.gl-login__forgot:focus-visible,
.gl-login__submit:focus-visible,
.gl-login__check input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-login__card {
    background: rgba(8, 24, 16, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-login__card {
    background: #0c2116;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-login__card {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-login__card,
  .gl-login__input {
    border-color: CanvasText;
  }
  .gl-login__show[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}

Weather card over a fjord

  • light glass
  • aria-pressed toggle
  • saturate()

Aurland

Tuesday, 14:00

14°

Partly cloudy
H 16° · L 8°

  • 15:0015°
  • 16:0015°
  • 17:0013°
  • 18:0011°
  • 19:0010°

Light glass works when the text is dark: a 0.6 white fill lifts the darkest water and rock high enough for navy text. The saturate() step after blur() keeps the sky blue instead of washing it out to grey. The unit switch is a pair of aria-pressed buttons that convert every value stored in a data attribute.

View code
.gl-weather {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 40px 16px;
  background: #3c6fa8 url("fjord.webp") center 60% / cover no-repeat;
}
.gl-weather__card {
  box-sizing: border-box;
  width: min(100%, 360px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 26px;
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: 0 18px 40px rgba(10, 30, 60, .25);
  color: #0c1d2e;
}
.gl-weather__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.gl-weather__city {
  margin: 0;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  color: #0c1d2e;
}
.gl-weather__date {
  margin: 2px 0 0;
  font-size: 13px;
  color: #22384d;
}
.gl-weather__units {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(12, 29, 46, .1);
}
.gl-weather__units button {
  min-width: 40px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: #0c1d2e;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.gl-weather__units [aria-pressed="true"] {
  background: #0c1d2e;
  color: #fff;
}
.gl-weather__units button:focus-visible {
  outline: 2px solid #0c1d2e;
  outline-offset: 2px;
}
.gl-weather__now {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}
.gl-weather__icon {
  width: 64px;
  height: 64px;
}
.gl-weather__temp {
  margin: 0;
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
}
.gl-weather__cond {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #1a3047;
}
.gl-weather__hours {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gl-weather__hours li {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  padding: 10px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .45);
  font-size: 12px;
  color: #1a3047;
}
.gl-weather__hours b {
  font-size: 15px;
  color: #0c1d2e;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-weather__card {
    background: rgba(255, 255, 255, .9);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-weather__card {
    background: #eef3f8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-weather__card {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-weather__card {
    border-color: CanvasText;
  }
  .gl-weather__units [aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}

Frosted credit card

  • solid shapes backdrop
  • aspect-ratio
  • hover tilt

Halden

Card ending in 4821

Card holderMara Ellison

Expires09/29

Debit

No photo needed: three flat circles behind the card are enough detail for the blur to show. The fill is a dark navy at 0.55 alpha, because white text over the blurred coral circle would drop to about 2:1 with a plain white tint. The tilt on hover only runs when the user has not asked for reduced motion.

View code
.gl-card {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 440px);
  min-height: 300px;
}
.gl-card__shape {
  position: absolute;
  border-radius: 50%;
}
.gl-card__shape--a {
  top: 8px;
  left: 4%;
  width: 170px;
  height: 170px;
  background: #ff7a59;
}
.gl-card__shape--b {
  right: 2%;
  bottom: 6px;
  width: 150px;
  height: 150px;
  background: #2ec4b6;
}
.gl-card__shape--c {
  top: 30px;
  right: 18%;
  width: 64px;
  height: 64px;
  background: #ffd166;
}
.gl-card__face {
  position: relative;
  box-sizing: border-box;
  display: grid;
  align-content: space-between;
  width: min(100%, 340px);
  aspect-ratio: 1.586;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 18px;
  background: rgba(16, 18, 38, .55);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .35);
  color: #fff;
}
.gl-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gl-card__row--end {
  align-items: flex-end;
}
.gl-card__bank {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
}
.gl-card__wave {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
}
.gl-card__chip {
  width: 42px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 7px;
  background: #e9c46a;
  box-shadow: inset 14px 0 0 -13px rgba(0, 0, 0, .35), inset -14px 0 0 -13px rgba(0, 0, 0, .35), inset 0 10px 0 -9px rgba(0, 0, 0, .35);
}
.gl-card__number {
  margin: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: clamp(16px, 5vw, 20px);
  letter-spacing: .08em;
  white-space: nowrap;
}
.gl-card__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.gl-card__meta {
  display: grid;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.gl-card__meta span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #e4e6f0;
}
.gl-card__type {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-card__face {
    transition: transform .4s ease;
  }
  .gl-card:hover .gl-card__face {
    transform: perspective(900px) rotateX(6deg) rotateY(-10deg);
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-card__face {
    background: rgba(16, 18, 38, .9);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-card__face {
    background: #1a1c33;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-card__face {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-card__face {
    border-color: CanvasText;
  }
}

Profile card over canal houses

  • light glass
  • definition list
  • aria-pressed

Ines Vermeer

Urban sketcher, Utrecht

Sketches
312
Followers
8.4k
Following
190

A busy, colorful street needs a heavier frost: blur(22px) and a 0.72 white fill turn the houses into soft color fields behind dark text. The avatar is a solid disc with initials, dark enough for white letters. The follow button keeps one accessible name and reports its state with aria-pressed.

View code
.gl-profile {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 40px 16px;
  background: #6b8a8f url("canal-houses.webp") center / cover no-repeat;
}
.gl-profile__card {
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  width: min(100%, 320px);
  padding: 28px 22px 22px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 28px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 22px 48px rgba(20, 30, 40, .28);
  color: #16202a;
  text-align: center;
}
.gl-profile__avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 0 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #a63d24;
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
}
.gl-profile__name {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: #16202a;
}
.gl-profile__role {
  margin: 4px 0 18px;
  font-size: 14px;
  color: #2f3b46;
}
.gl-profile__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin: 0 0 20px;
  padding: 12px 0;
  border-top: 1px solid rgba(22, 32, 42, .2);
  border-bottom: 1px solid rgba(22, 32, 42, .2);
}
.gl-profile__stats div {
  display: flex;
  flex-direction: column-reverse;
}
.gl-profile__stats dt {
  font-size: 12px;
  color: #2f3b46;
}
.gl-profile__stats dd {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.gl-profile__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.gl-profile__follow,
.gl-profile__msg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.gl-profile__follow {
  border: 1px solid #16202a;
  background: #16202a;
  color: #fff;
}
.gl-profile__follow svg {
  display: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gl-profile__follow[aria-pressed="true"] {
  background: #fff;
  color: #16202a;
}
.gl-profile__follow[aria-pressed="true"] svg {
  display: block;
}
.gl-profile__msg {
  border: 1px solid rgba(22, 32, 42, .55);
  background: rgba(255, 255, 255, .35);
  color: #16202a;
}
.gl-profile__msg:hover {
  background: rgba(255, 255, 255, .7);
}
.gl-profile__follow:focus-visible,
.gl-profile__msg:focus-visible {
  outline: 2px solid #16202a;
  outline-offset: 3px;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-profile__card {
    background: rgba(255, 255, 255, .93);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-profile__card {
    background: #f4f2ee;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-profile__card {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-profile__card {
    border-color: CanvasText;
  }
  .gl-profile__follow[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}

Glass caption on an image

  • figure / figcaption
  • aria-expanded
  • hidden attribute
A hiker with a large backpack stands on a rocky ledge, looking out over hazy mountain ridges in warm morning light.
Morning above the haze Trail series, 4 of 12

The caption floats inside the photo instead of under it. The haze in this shot is almost white, so the brown tint goes up to 0.62 alpha before the white text clears 4.5:1 everywhere. The details button expands the caption with aria-expanded and the hidden attribute.

View code
.gl-cap {
  position: relative;
  width: min(100%, 460px);
  margin: 0;
}
.gl-cap__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}
.gl-cap__text {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 12px 12px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 14px;
  background: rgba(24, 16, 8, .62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
}
.gl-cap__title {
  font-size: 15px;
  font-weight: 700;
}
.gl-cap__credit {
  grid-row: 2;
  font-size: 12px;
  color: #f1e6da;
}
.gl-cap__more {
  grid-row: 1 / 3;
  grid-column: 2;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease;
}
.gl-cap__more:hover {
  background: rgba(255, 255, 255, .2);
}
.gl-cap__more[aria-expanded="true"] {
  border-color: #fff;
  background: #fff;
  color: #24180c;
}
.gl-cap__more:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.gl-cap__extra {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #f1e6da;
}
.gl-cap__extra[hidden] {
  display: none;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-cap__text {
    background: rgba(24, 16, 8, .9);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-cap__text {
    background: #22180f;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-cap__text {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-cap__text {
    border-color: CanvasText;
  }
}

Glass widgets and controls

Small interactive surfaces where glass is at home: players, buttons, sliders, tiles and tooltips. The backdrops are illustrated scenes, photos or flat colored shapes, never a gradient.

Music player widget

  • SVG scene backdrop
  • :has()
  • accent-color

Low Tide Radio

The Saltmarsh

1:183:34

A warm light glass over an illustrated dusk scene, with plum text that stays readable over the darkest hills. The equalizer bars animate only while the play button reports aria-pressed="true", which :has() reads from the card. The seek bar is a native range input with accent-color, so it keeps keyboard support for free.

View code
.gl-music {
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: 40px 16px;
  background: #ffd9b8 url("plx-scene-dusk.svg") center bottom / cover no-repeat;
}
.gl-music__card {
  box-sizing: border-box;
  width: min(100%, 340px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 24px;
  background: rgba(255, 246, 238, .62);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 18px 40px rgba(60, 30, 60, .25);
  color: #24162e;
}
.gl-music__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}
.gl-music__art {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 14px;
  background: #5b3a73;
}
.gl-music__art i {
  position: absolute;
  border-radius: 50%;
}
.gl-music__art i:first-child {
  top: 12px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: #ff8a5b;
}
.gl-music__art i:last-child {
  bottom: -30px;
  left: -10px;
  width: 80px;
  height: 56px;
  background: #ffd9b8;
}
.gl-music__title {
  margin: 0;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: #24162e;
}
.gl-music__artist {
  margin: 2px 0 0;
  font-size: 14px;
  color: #45304f;
}
.gl-music__eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}
.gl-music__eq i {
  width: 4px;
  height: 6px;
  border-radius: 2px;
  background: #24162e;
  transform-origin: bottom;
}
.gl-music__eq i:nth-child(2) {
  height: 14px;
}
.gl-music__eq i:nth-child(3) {
  height: 10px;
}
.gl-music__eq i:nth-child(4) {
  height: 18px;
}
.gl-music__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.gl-music__seek {
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #24162e;
  cursor: pointer;
}
.gl-music__times {
  display: flex;
  justify-content: space-between;
  margin: 2px 0 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #45304f;
}
.gl-music__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.gl-music__btn,
.gl-music__play {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}
.gl-music__btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(36, 22, 46, .35);
  background: rgba(255, 255, 255, .4);
  color: #24162e;
  transition: background-color .2s ease;
}
.gl-music__btn:hover {
  background: rgba(255, 255, 255, .75);
}
.gl-music__btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.gl-music__play {
  width: 56px;
  height: 56px;
  border: 0;
  background: #24162e;
  color: #fff;
}
.gl-music__play svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.gl-music__i-pause,
.gl-music__play[aria-pressed="true"] .gl-music__i-play {
  display: none;
}
.gl-music__play[aria-pressed="true"] .gl-music__i-pause {
  display: block;
}
.gl-music__btn:focus-visible,
.gl-music__play:focus-visible,
.gl-music__seek:focus-visible {
  outline: 2px solid #24162e;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-music__card:has(.gl-music__play[aria-pressed="true"]) .gl-music__eq i {
    animation: gl-music-eq .9s ease-in-out infinite alternate;
  }
  .gl-music__card:has(.gl-music__play[aria-pressed="true"]) .gl-music__eq i:nth-child(2) {
    animation-delay: -.3s;
  }
  .gl-music__card:has(.gl-music__play[aria-pressed="true"]) .gl-music__eq i:nth-child(3) {
    animation-delay: -.6s;
  }
  .gl-music__card:has(.gl-music__play[aria-pressed="true"]) .gl-music__eq i:nth-child(4) {
    animation-delay: -.15s;
  }
}
@keyframes gl-music-eq {
  to {
    transform: scaleY(.35);
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-music__card {
    background: rgba(255, 246, 238, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-music__card {
    background: #fbefe6;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-music__card {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-music__card,
  .gl-music__btn {
    border-color: CanvasText;
  }
  .gl-music__play {
    border: 2px solid ButtonText;
  }
}

Glass buttons on colored shapes

  • light and dark glass
  • aria-pressed
  • :active press

Two glass weights for two jobs: the primary action uses a 0.8 white fill with dark text, the secondary ones a 0.6 ink fill with white text. Both were checked over the yellow circle, the brightest spot behind them. Hover only raises the fill alpha, and the press nudge is gated behind prefers-reduced-motion.

View code
.gl-btns {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  width: min(100%, 460px);
  min-height: 280px;
}
.gl-btns__shape {
  position: absolute;
}
.gl-btns__shape--a {
  top: 20px;
  left: 6%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #ffd23f;
}
.gl-btns__shape--b {
  right: 4%;
  bottom: 18px;
  width: 140px;
  height: 140px;
  border-radius: 32px;
  background: #3a86ff;
  transform: rotate(18deg);
}
.gl-btns__shape--c {
  bottom: 40px;
  left: 30%;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #ff5d8f;
}
.gl-btns__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.gl-btns__btn,
.gl-btns__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(10, 12, 26, .6);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.gl-btns__btn {
  padding: 0 22px;
  border-radius: 14px;
}
.gl-btns__btn--pill {
  padding: 0 10px 0 20px;
  border-radius: 999px;
}
.gl-btns__icon {
  width: 48px;
  padding: 0;
  border-radius: 50%;
}
.gl-btns__btn:hover,
.gl-btns__icon:hover {
  border-color: rgba(255, 255, 255, .7);
  background: rgba(10, 12, 26, .75);
}
.gl-btns__btn--light {
  border-color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .8);
  color: #10131f;
}
.gl-btns__btn--light:hover {
  background: rgba(255, 255, 255, .95);
}
.gl-btns__count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: #10131f;
  font-size: 13px;
}
.gl-btns__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gl-btns__save[aria-pressed="true"] {
  border-color: #fff;
  background: #fff;
  color: #d6235a;
}
.gl-btns__save[aria-pressed="true"] svg {
  fill: currentColor;
}
.gl-btns__btn:focus-visible,
.gl-btns__icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-btns__btn,
  .gl-btns__icon {
    transition: background-color .2s ease, border-color .2s ease, transform .15s ease;
  }
  .gl-btns__btn:active,
  .gl-btns__icon:active {
    transform: translateY(1px) scale(.98);
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-btns__btn,
  .gl-btns__icon {
    background: rgba(10, 12, 26, .9);
  }
  .gl-btns__btn--light {
    background: #fff;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-btns__btn,
  .gl-btns__icon {
    background: #14172a;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-btns__btn--light {
    background: #fff;
  }
}
@media (forced-colors: active) {
  .gl-btns__btn,
  .gl-btns__icon {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-btns__btn,
  .gl-btns__icon {
    border-color: ButtonText;
  }
  .gl-btns__save[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}

Settings panel with sliders

  • range inputs
  • role="switch"
  • output element

Display

72%
4200 K
17 px
Dim at sunset
Match room light

Dark glass over a night scene. The moon is the risky spot, so the navy tint sits at 0.62 alpha and the moon blurs into a soft glow instead of a white disc behind the labels. Each slider writes its value into an output element, and the two switches use role="switch" with aria-checked.

View code
.gl-set {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 40px 16px;
  background: #11182e url("plx-scene-night.svg") 70% bottom / cover no-repeat;
}
.gl-set__panel {
  box-sizing: border-box;
  width: min(100%, 340px);
  padding: 22px 22px 10px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 22px;
  background: rgba(8, 12, 32, .62);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .4);
  color: #fff;
}
.gl-set__title {
  margin: 0 0 14px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: #fff;
}
.gl-set__field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin: 0 0 12px;
  font-size: 14px;
}
.gl-set__field output {
  font-variant-numeric: tabular-nums;
  color: #dbe4ff;
}
.gl-set__field input {
  grid-column: 1 / -1;
  width: 100%;
  height: 28px;
  margin: 4px 0 0;
  accent-color: #a8c4ff;
  cursor: pointer;
}
.gl-set__switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: 14px;
}
.gl-set__switch button {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: background-color .2s ease;
}
.gl-set__switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
}
.gl-set__switch [aria-checked="true"] {
  border-color: #a8c4ff;
  background: #a8c4ff;
}
.gl-set__switch [aria-checked="true"] i {
  left: 25px;
  background: #0b1230;
}
.gl-set__field input:focus-visible,
.gl-set__switch button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-set__switch i {
    transition: left .2s ease, background-color .2s ease;
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-set__panel {
    background: rgba(8, 12, 32, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-set__panel {
    background: #0d1430;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-set__panel {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-set__panel {
    border-color: CanvasText;
  }
  .gl-set__switch button {
    border-color: ButtonText;
  }
  .gl-set__switch i {
    background: ButtonText;
  }
  .gl-set__switch [aria-checked="true"] {
    background: Highlight;
  }
}

Control center tiles in a phone

  • CSS grid tiles
  • vertical range
  • aria-pressed

Field Notes

Aster Lane

A grid of glass tiles over a wallpaper, in the style of a phone control center. Active toggles turn solid white, so the on state never depends on a subtle tint change. The two tall sliders are native range inputs set to writing-mode: vertical-lr, laid transparently over a fill bar that reads the value from a custom property.

View code
.gl-ctl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 20px 16px;
  background: #3d4a3a url("granite-valley.webp") 40% center / cover no-repeat;
}
.gl-ctl__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  max-height: 470px;
}
.gl-ctl__tile,
.gl-ctl__glass {
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(16, 20, 24, .52);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  color: #fff;
}
.gl-ctl__tile {
  box-sizing: border-box;
  min-width: 0;
  border-radius: 22px;
}
.gl-ctl__net {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column: span 2;
  grid-row: span 2;
  place-items: center;
  padding: 10px;
}
.gl-ctl__round {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.gl-ctl__glass {
  justify-self: center;
}
.gl-ctl svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gl-ctl__fill {
  fill: currentColor;
  stroke: none;
}
.gl-ctl__round[aria-pressed="true"],
.gl-ctl__wide[aria-pressed="true"] {
  border-color: #fff;
  background: #fff;
  color: #14181c;
}
.gl-ctl__now {
  display: grid;
  grid-column: span 2;
  grid-row: span 2;
  align-content: end;
  padding: 14px;
}
.gl-ctl__song {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gl-ctl__artist {
  margin: 0 0 8px;
  font-size: 13px;
  color: #e6ebef;
}
.gl-ctl__mini {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #14181c;
  cursor: pointer;
}
.gl-ctl__i-pause,
.gl-ctl__mini[aria-pressed="true"] .gl-ctl__i-play {
  display: none;
}
.gl-ctl__mini[aria-pressed="true"] .gl-ctl__i-pause {
  display: block;
}
.gl-ctl__wide {
  display: flex;
  grid-column: span 2;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.gl-ctl__wide svg {
  flex: none;
}
.gl-ctl__focus {
  grid-row: 3;
  grid-column: 1 / 3;
}
.gl-ctl__lock {
  grid-row: 4;
  grid-column: 1 / 3;
}
.gl-ctl__slider {
  position: relative;
  grid-row: 3 / 5;
  display: grid;
  align-items: end;
  justify-items: center;
  overflow: hidden;
  padding-bottom: 12px;
}
.gl-ctl__bright {
  grid-column: 3;
}
.gl-ctl__vol {
  grid-column: 4;
}
.gl-ctl__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--gl-ctl-v) * 1%);
  background: #fff;
}
.gl-ctl__slider svg {
  position: relative;
  color: #14181c;
}
.gl-ctl__slider input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  writing-mode: vertical-lr;
  direction: rtl;
  cursor: pointer;
}
.gl-ctl__slider:has(input:focus-visible),
.gl-ctl__round:focus-visible,
.gl-ctl__wide:focus-visible,
.gl-ctl__mini:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.gl-ctl__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-column: 1 / -1;
  align-items: center;
}
.gl-ctl__row .gl-ctl__round {
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(16, 20, 24, .52);
}
.gl-ctl__row .gl-ctl__round[aria-pressed="true"] {
  background: #fff;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-ctl__tile,
  .gl-ctl__glass,
  .gl-ctl__row .gl-ctl__round {
    background: rgba(16, 20, 24, .9);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-ctl__tile,
  .gl-ctl__glass,
  .gl-ctl__row .gl-ctl__round {
    background: #1b2024;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-ctl__tile,
  .gl-ctl__glass,
  .gl-ctl__row .gl-ctl__round {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-ctl__tile,
  .gl-ctl__round {
    border: 1px solid CanvasText;
  }
  .gl-ctl__round[aria-pressed="true"],
  .gl-ctl__wide[aria-pressed="true"] {
    outline: 3px solid Highlight;
  }
  .gl-ctl__bar {
    background: Highlight;
  }
}

Glass tooltips and a map popover

  • role="tooltip"
  • aria-expanded
  • Escape to dismiss

Hover or tab to the tools, then open a trail pin.

A light glass toolbar with dark glass tooltips, and a trail pin that opens a dark glass popover. Tooltips show on hover and keyboard focus and hide with Escape, as WCAG 1.4.13 asks. The popover position is clamped with clamp() so it never leaves the map, even on a 340px wide stage.

View code
.gl-map {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #8a4a2a url("red-rock-canyon.webp") center / cover no-repeat;
}
.gl-map__tools {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 14px;
  background: rgba(255, 250, 245, .72);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  z-index: 2;
}
.gl-map__tool {
  position: relative;
}
.gl-map__tool button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #2a160c;
  cursor: pointer;
  transition: background-color .2s ease;
}
.gl-map__tool button:hover {
  background: rgba(42, 22, 12, .1);
}
.gl-map__tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gl-map__tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  background: rgba(24, 12, 6, .7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.gl-map__tool:hover .gl-map__tip,
.gl-map__tool:has(:focus-visible) .gl-map__tip {
  opacity: 1;
}
.gl-map--quiet .gl-map__tool .gl-map__tip {
  opacity: 0;
}
.gl-map__pin {
  position: absolute;
  top: var(--gl-map-y);
  left: var(--gl-map-x);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px 0 8px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(24, 12, 6, .7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.gl-map__pin::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f3722c;
}
.gl-map__pin[aria-expanded="true"] {
  background: #fff;
  color: #2a160c;
}
.gl-map__pop {
  position: absolute;
  bottom: calc(100% - var(--gl-map-y) + 26px);
  left: clamp(12px, calc(var(--gl-map-x) - 130px), calc(100% - 272px));
  box-sizing: border-box;
  width: min(260px, calc(100% - 24px));
  padding: 14px 40px 14px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 16px;
  background: rgba(24, 12, 6, .68);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .35);
  color: #fff;
  z-index: 3;
}
.gl-map__pop[hidden] {
  display: none;
}
.gl-map__name {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
}
.gl-map__facts {
  margin: 0 0 6px;
  font-size: 12px;
  color: #ffe2cc;
}
.gl-map__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.gl-map__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.gl-map__tool button:focus-visible,
.gl-map__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #2a160c;
}
.gl-map__pin:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-map__tools {
    background: rgba(255, 250, 245, .94);
  }
  .gl-map__tip,
  .gl-map__pin,
  .gl-map__pop {
    background: rgba(24, 12, 6, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-map__tools {
    background: #fff8f2;
  }
  .gl-map__tip,
  .gl-map__pin,
  .gl-map__pop {
    background: #2a160c;
  }
  .gl-map__tools,
  .gl-map__tip,
  .gl-map__pin,
  .gl-map__pop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-map__tools,
  .gl-map__tip,
  .gl-map__pin,
  .gl-map__pop {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-map__tools,
  .gl-map__tip,
  .gl-map__pin,
  .gl-map__pop {
    border-color: CanvasText;
  }
}

Glass in page layouts

Larger panels that float over real page content: a navigation bar, pricing tiers, a notification stack, a sidebar and a modal. The last demo puts light and dark glass over the same photo so you can compare the two recipes.

Pricing tiers over a sea scene

  • auto-fit grid
  • :has() billing switch
  • fieldset radios

Plans for small studios

Billing period

Solo

$12$10 / month

  • 1 editor
  • 3 client sites
  • Email support

Studio

$29$24 / month

  • 5 editors
  • Unlimited sites
  • Shared asset library

Agency

$79$66 / month

  • 20 editors
  • Client billing
  • Priority support

Three light glass tiers over an illustrated sea, with the recommended plan in a heavier fill and a dark border. The monthly and yearly switch is a pair of radio buttons, and :has() on the wrapper swaps the prices without any script. The darkest teal band was the worst spot for the dark text, so the fill sits at 0.66.

View code
.gl-price {
  padding: 40px 20px 48px;
  background: #d4ece6 url("plx-scene-sea.svg") center bottom / cover no-repeat;
  color: #0b2426;
  text-align: center;
}
.gl-price__title {
  margin: 0 0 16px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
  color: #0b2426;
}
.gl-price__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.gl-price__switch {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0 0 24px;
  padding: 4px;
  border: 1px solid rgba(11, 36, 38, .3);
  border-radius: 14px;
  background: rgba(255, 255, 255, .6);
}
.gl-price__switch label {
  position: relative;
  cursor: pointer;
}
.gl-price__switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.gl-price__switch span {
  display: block;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.gl-price__switch input:checked + span {
  background: #0b2426;
  color: #fff;
}
.gl-price__switch input:focus-visible + span {
  outline: 2px solid #0b2426;
  outline-offset: 2px;
}
.gl-price__tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}
.gl-price__tier {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 20px;
  background: rgba(255, 255, 255, .66);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 16px 36px rgba(6, 40, 44, .18);
  text-align: left;
}
.gl-price__tier--pick {
  border: 2px solid #0b2426;
  background: rgba(255, 255, 255, .8);
}
.gl-price__name {
  margin: 0;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: #0b2426;
}
.gl-price__amount {
  margin: 6px 0 12px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
}
.gl-price__amount small {
  font-size: 14px;
  font-weight: 500;
  color: #1d3f42;
}
.gl-price__y,
.gl-price:has(input[value="yearly"]:checked) .gl-price__m {
  display: none;
}
.gl-price:has(input[value="yearly"]:checked) .gl-price__y {
  display: inline;
}
.gl-price__list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
  color: #1d3f42;
}
.gl-price__list li {
  margin: 0;
  padding: 4px 0;
  border-top: 1px solid rgba(11, 36, 38, .15);
}
.gl-price__btn {
  height: 44px;
  border: 1px solid #0b2426;
  border-radius: 12px;
  background: transparent;
  color: #0b2426;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.gl-price__tier--pick .gl-price__btn,
.gl-price__btn:hover {
  background: #0b2426;
  color: #fff;
}
.gl-price__btn:focus-visible {
  outline: 2px solid #0b2426;
  outline-offset: 3px;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-price__tier {
    background: rgba(255, 255, 255, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-price__tier {
    background: #f3faf8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-price__tier {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-price__tier {
    border-color: CanvasText;
  }
  .gl-price__switch input:checked + span {
    outline: 2px solid Highlight;
  }
}

Collapsible notification stack

  • grid stacking
  • inert
  • aria-live

Notifications

  • Ridgeline · now

    Your 07:30 hike leaves in 45 minutes. Rain is unlikely until noon.

  • Parcelly · 12 min

    Package 2 of 3 was left at the side door.

  • Kettle Chat · 1 h

    Dana: are we still on for the alley mural tour on Saturday?

Three dark glass notifications stacked on one grid cell, with the older two peeking out below. Expanding the stack lays them out in a column and removes inert from the hidden cards, so keyboard users never land on a card they cannot see. Dismissing a card announces it through a polite live region.

View code
.gl-note {
  display: grid;
  place-items: start center;
  min-height: 460px;
  padding: 36px 16px;
  background: #3a2620 url("brick-alley.webp") center / cover no-repeat;
}
.gl-note__wrap {
  width: min(100%, 360px);
}
.gl-note__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 14px;
  background: rgba(14, 10, 12, .62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.gl-note__title {
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: #fff;
}
.gl-note__toggle {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.gl-note__toggle[hidden] {
  display: none;
}
.gl-note__list {
  display: grid;
  margin: 0;
  padding: 0 0 26px;
  list-style: none;
}
.gl-note__item {
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 12px;
  margin: 0;
  padding: 14px 44px 14px 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 18px;
  background: rgba(14, 10, 12, .62);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
  color: #fff;
}
.gl-note__item:nth-child(1) {
  z-index: 3;
}
.gl-note__item:nth-child(2) {
  z-index: 2;
  transform: translateY(13px) scale(.95);
}
.gl-note__item:nth-child(3) {
  z-index: 1;
  transform: translateY(26px) scale(.9);
}
.gl-note__list:not(:has(.gl-note__item:nth-child(2))) {
  padding-bottom: 0;
}
.gl-note__app {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--gl-note-c);
  color: #fff;
  font-weight: 700;
}
.gl-note__meta {
  margin: 0;
  font-size: 13px;
  color: #ece4e0;
}
.gl-note__meta b {
  color: #fff;
}
.gl-note__msg {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.4;
}
.gl-note__dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.gl-note__wrap:has([aria-expanded="true"]) .gl-note__list {
  gap: 10px;
  padding-bottom: 0;
}
.gl-note__wrap:has([aria-expanded="true"]) .gl-note__item {
  grid-area: auto;
  transform: none;
}
.gl-note__status {
  margin: 10px 0 0;
  font-size: 13px;
  color: #fff;
}
.gl-note__status:empty {
  display: none;
}
.gl-note__toggle:focus-visible,
.gl-note__dismiss:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-note__item {
    transition: transform .3s ease;
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-note__head,
  .gl-note__item {
    background: rgba(14, 10, 12, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-note__head,
  .gl-note__item {
    background: #1a1416;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-note__head,
  .gl-note__item {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-note__head,
  .gl-note__item {
    border-color: CanvasText;
  }
}

Dashboard sidebar over content

  • glass overlay sidebar
  • aria-expanded collapse
  • aria-current

Active sensors

1,284

Water temp

14.2 °C

On wide screens the sidebar pushes the content aside, and under 640px a container query lets it float over the white stat cards, which is where glass earns its keep: you can still sense the content it covers. Collapsing it to an icon rail keeps the labels as visually hidden text, so the links keep their names. White cards behind the panel were the worst spot, so the navy tint is 0.66.

View code
.gl-dash {
  position: relative;
  container-type: inline-size;
  min-height: 440px;
  overflow: hidden;
  background: #0c3a7a url("jellyfish.webp") 70% center / cover no-repeat;
}
.gl-dash__side {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 14px;
  box-sizing: border-box;
  width: 210px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px;
  background: rgba(4, 18, 42, .66);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  color: #fff;
  z-index: 2;
}
.gl-dash__side:has([aria-expanded="false"]) {
  width: 66px;
}
.gl-dash__toggle {
  position: absolute;
  top: 14px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
}
.gl-dash__side:has([aria-expanded="false"]) .gl-dash__toggle {
  position: static;
  margin: 0 auto 10px;
  transform: scaleX(-1);
}
.gl-dash svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gl-dash__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  margin: 0 0 18px;
  padding-left: 12px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
}
.gl-dash__dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff9f43;
}
.gl-dash__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 4px;
  padding: 0 12px;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  transition: background-color .2s ease;
}
.gl-dash__link:hover {
  background: rgba(255, 255, 255, .12);
}
.gl-dash__link[aria-current="page"] {
  background: #fff;
  color: #04122a;
}
.gl-dash__side:has([aria-expanded="false"]) .gl-dash__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.gl-dash__side:has([aria-expanded="false"]) .gl-dash__brand {
  display: none;
}
.gl-dash__toggle:focus-visible,
.gl-dash__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.gl-dash__main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-content: start;
  gap: 14px;
  padding: 24px 20px 24px 100px;
}
@container (min-width: 640px) {
  .gl-dash__main {
    padding-left: 244px;
  }
  .gl-dash:has([aria-expanded="false"]) .gl-dash__main {
    padding-left: 100px;
  }
}
.gl-dash__stat {
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  color: #04122a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}
.gl-dash__stat p {
  margin: 0 0 4px;
  font-size: 13px;
  color: #3b4a63;
}
.gl-dash__stat b {
  font-size: 24px;
}
.gl-dash__chart {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-end;
  gap: 8%;
  height: 150px;
}
.gl-dash__chart i {
  flex: 1;
  height: var(--gl-dash-h);
  border-radius: 6px 6px 0 0;
  background: #1f5aa6;
}
.gl-dash__chart i:nth-child(4) {
  background: #ff9f43;
}
@media (prefers-reduced-motion: no-preference) {
  .gl-dash__side {
    transition: width .3s ease;
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-dash__side {
    background: rgba(4, 18, 42, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-dash__side {
    background: #08183a;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .gl-dash__side {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-dash__side,
  .gl-dash__toggle {
    border-color: CanvasText;
  }
  .gl-dash__link[aria-current="page"] {
    outline: 2px solid Highlight;
  }
}

Dark glass vs light glass

  • side by side recipes
  • worst-spot contrast
  • container wrap

Light glass

Fill
rgb(255 255 255 / .7)
Border
1px, white at 80%
Blur
blur(18px) saturate(140%)
Text
#101820
Worst spot
10.9:1

Dark glass

Fill
rgb(10 14 24 / .6)
Border
1px, white at 25%
Blur
blur(18px) saturate(140%)
Text
#ffffff
Worst spot
5.2:1

The same skyline behind both panels: bright sky at the top, dark towers below. Dark text on a 0.7 white fill keeps plenty of headroom, while white text on a 0.6 ink fill comes much closer to the 4.5:1 line, because the sky is the brighter extreme. The ratios printed on each panel are the measured worst spots across the desktop and mobile layouts, not averages.

View code
.gl-duo {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 20px;
  padding: 44px 16px;
  background: #6f6a66 url("city-skyline.webp") center / cover no-repeat;
}
.gl-duo__panel {
  box-sizing: border-box;
  flex: 1 1 260px;
  max-width: 320px;
  padding: 22px;
  border-radius: 20px;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
}
.gl-duo__panel--light {
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .7);
  color: #101820;
}
.gl-duo__panel--dark {
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(10, 14, 24, .6);
  color: #fff;
}
.gl-duo__title {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: inherit;
}
.gl-duo__spec {
  margin: 0;
}
.gl-duo__spec div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 0;
  border-top: 1px solid currentColor;
  border-top-color: rgba(128, 128, 128, .45);
  font-size: 14px;
}
.gl-duo__spec dt {
  font-weight: 600;
}
.gl-duo__spec dd {
  margin: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.gl-duo__ratio {
  font-weight: 700;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gl-duo__panel--light {
    background: rgba(255, 255, 255, .93);
  }
  .gl-duo__panel--dark {
    background: rgba(10, 14, 24, .92);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gl-duo__panel {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-duo__panel--light {
    background: #f4f5f7;
  }
  .gl-duo__panel--dark {
    background: #10141e;
  }
}
@media (forced-colors: active) {
  .gl-duo__panel {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .gl-duo__panel {
    border-color: CanvasText;
  }
}

What is CSS glassmorphism?

Put a semi-transparent, blurred panel over a colorful backdrop and whatever sits behind it shows through like frosted glass. That’s glassmorphism in CSS.

backdrop-filter softens everything behind the element. An rgba() or hsla() background lets color through, a 1px semi-transparent white border marks the edge of the pane, and box-shadow lifts it off the page.

WebKit proposed backdrop-filter for the CSS Filter Effects Module Level 2 to reproduce the blur used in iOS 7 and OS X Yosemite, according to the WebKit blog.

The look got its name later. Designer Michal Malewicz coined “glassmorphism” in 2020, the year Apple’s macOS Big Sur shipped glassy menu dropdowns and translucent sidebars (Webflow).

Web designers now treat it as a glassmorphism design trend they rebuild with plain CSS, no image assets needed.

CSS handles the frosted blur and the translucent tint with its light edge. A soft shadow adds depth. Reflection and refraction are another matter, since neither exists as a single property, and faking them takes extra gradient layers stacked on the base effect.

As of October 2026, backdrop-filter holds Baseline “newly available” status, dated to September 2024 when Safari 18 shipped it unprefixed (web-features data, MDN).

How to build a glassmorphism card in CSS

Everything goes on one element. A translucent background and backdrop-filter: blur() do most of the work, and a light border plus a box-shadow finish it.

Build it over a colorful backdrop, because blur on a plain page shows nothing:

  1. Place the card over a gradient or photo.
  2. Set a translucent fill with rgba(255, 255, 255, 0.15).
  3. Add blur(10px) to backdrop-filter, with the -webkit- version written first.
  4. Draw the edge with a 1px border at 30% white, plus a border-radius.
  5. Add a soft box-shadow for lift.
  6. Toggle each property in Chrome DevTools to see what it contributes.

The finished class looks like this:

.glass-card {
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.25);
  padding: 24px;
}

backdrop-filter takes the same function list as filter, so blur() can sit beside saturate() or brightness() in one declaration (MDN).

Shadows matter more on glass than on solid cards, at least in my experience. A wide, soft shadow is what separates the panel from a backdrop the blur has already muted. There are more shadow effects you can build in CSS than the single value used here.

Rounded corners sell the pane. Try other values in a border radius generator before you commit.

Which blur and opacity values work best?

Start with a blur near 10px and a white fill between 0.1 and 0.25 alpha, then adjust against the real backdrop.

CSSmatic’s glass preset uses a 0.25 alpha fill, 10px blur and a 1px border at 0.4 alpha.

BlurLookFits
5pxSoft, backdrop shapes still readableLight overlays
10pxBalanced frostCards, navigation bars
25pxBackdrop detail dissolvesModals over busy photos

Higher blur hides busy detail behind text. A higher alpha does the same job from the other side by tinting the panel more heavily.

Put the alpha on the background with rgba(), not on the element with opacity. The first fades only the fill. The second fades the text and every child too, which CSSPortal’s generator guide advises against.

Use backdrop-filter rather than filter here. The first blurs only what sits behind the element, while filter: blur() blurs the element and its text (MDN). That separate case is covered in the guide to the CSS blur effect.

Stacking helps too. web.dev’s own example combines brightness(150%) saturate(150%) blur(1rem), and a saturate() boost is the usual fix for color that blur washes out (the CSS-Tricks variant uses saturate(180%) blur(10px)).

Values depend on the backdrop, so test them against the actual background in a glassmorphism generator for CSS. Honestly, I’d rarely go past 20px.

What background makes the glass effect visible?

Colorful, varied backgrounds work. Multi-stop gradients let color shifts bleed through the tint, and photographs give the strongest frost, though contrast changes from one region to the next. An illustrated scene does the job as well.

Flat colors are the problem. There is nothing to soften, so the panel reads as a plain translucent box.

On a flat white page the effect is invisible no matter how correct the CSS is, as theplusaddons puts it in its 2026 guide.

Blur only changes areas with detail. A smooth gradient looks nearly the same blurred or unblurred, so shapes, image texture or text behind the card are what make the frost visible.

Webflow’s design guide makes the same point: something visually engaging has to sit behind the panel for the style to land.

Build the backdrop first with a gradient generator for CSS, then tune the glass over it.

Why is backdrop-filter not working?

When the blur does nothing, check the fill first. Most failures trace back to one of a handful of causes.

  • The background is opaque. The effect only shows through a translucent element, so use rgba() or hsla() on the fill (web.dev).
  • Nothing sits behind the panel, and a flat color gives the blur nothing to soften.
  • The -webkit- prefix is missing. Safari reads only -webkit-backdrop-filter before version 18 (September 2024).
  • An ancestor carries a filter or an opacity below 1, which cuts the blur off from the page behind it.
  • A child with its own backdrop-filter sits inside a blurred parent, and that nesting renders inconsistently.

The last two causes share a root in the spec. The W3C’s Filter Effects Module Level 2 draft stops a backdrop-filter from seeing past ancestors that have filters, opacity or other grouping properties, a boundary it calls the Backdrop Root.

The same draft says it does not yet have Working Group consensus on the definition of Backdrop Root. Engines disagree in practice: a WebKit bug filed in September 2024 reports that Safari on macOS renders only the parent’s blur when a child carries its own, while the reporter says Firefox applies both.

Chromium landed a fix for parents with opacity below 1 in February 2019, months before Chrome 76 shipped the property in July 2019.

Read together, the three sources give one working rule. Put backdrop-filter on an element whose ancestors carry no filter and no opacity below 1, and keep one blurred layer per stack. A parent that fades in with an opacity animation falls under the same rule while its opacity sits below 1.

To find the culprit, toggle backdrop-filter in the Styles pane of Chrome DevTools. Then step up through the ancestors and disable filter or opacity declarations one at a time.

Adding the blur also has a side effect. Any backdrop-filter value other than none creates a new stacking context (web.dev), so z-index order against neighboring elements can shift once the blur is added.

Which browsers support backdrop-filter, and what is the fallback?

All four major browsers run backdrop-filter. Chrome has it from 76, Edge from 79, Firefox from 103, and Safari unprefixed from 18.

BrowserFirst versionPrefix needed
Chrome76No
Edge79No
Firefox103No
Safari18Yes, -webkit- before 18

Sources disagree on Edge. web-features and web.dev start it at 79, while TestMu’s compatibility guide lists 17, the legacy EdgeHTML engine.

Current Edge runs on Chromium, so 79 is the working floor.

Older tutorials, freeCodeCamp’s among them, still say Firefox ships the property disabled. That ended with Firefox 103. Before it, users had to set layout.css.backdrop-filter.enabled and gfx.webrender.all in about:config (Can I Use).

Support lists age quickly, so cross-browser compatibility testing belongs in every release, not only the first build.

Writing the @supports fallback

Write the solid fallback first, then layer the glass inside @supports.

.glass-card {
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
}

@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
  .glass-card {
    background: rgba(255, 255, 255, 0.15);

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

The condition tests both the prefixed and the standard property, so older Safari builds still get the blur (CSS-Tricks).

web.dev recommends falling back to an image rather than a polyfill, citing performance.

Microsoft’s acrylic material follows the same logic. Fluent Design swaps it for a solid FallbackColor when Transparency effects are off or Battery Saver is on, and the docs tell designers to check that the fallback reads well as a plain color (Microsoft Learn).

How do you keep glassmorphism accessible?

Hold body text to 4.5:1 and large text and interface edges to 3:1 against the worst region of the backdrop, then let user settings swap the glass for a solid fill.

Contrast on a moving backdrop

  • Body text needs 4.5:1 under WCAG 2.2 SC 1.4.3 (W3C).
  • Large text, meaning 18pt or 14pt bold, needs 3:1 under the same criterion.
  • Interface components need 3:1 against adjacent colors under SC 1.4.11 (WebAIM).
  • A 12% white fill can swing from 8:1 to under 2:1 over a scrolling user photo (Superdesign).

WCAG offers no method for measuring text over semi-transparent colors, WebAIM notes, although that text must still pass.

So the test falls to you. Sample the lightest and darkest regions behind the card, and judge the text against the worse one.

W3C’s own guidance treats 3:1 and 4.5:1 as thresholds, and text can pass on paper while reading worse in practice. For the ratio math, the guide to color contrast walks through the formula.

The cheapest fix is raising the fill alpha until the worst region passes. If that is not enough, move long copy onto a more opaque inner layer.

Reduced transparency and contrast preferences

prefers-reduced-transparency works in Chrome and Edge from version 118, released in October 2023 (MDN). web-features starts the count at 119 because it also tracks a related client hint header.

Firefox keeps it behind a flag, and WebKit bug 175497 is still open, with Apple’s standards position flagging privacy concerns.

By Chrome Platform Status counts, backdrop-filter runs on about 37% of page loads and prefers-reduced-transparency on about 5.6%, roughly 7 to 1.

Both preferences, together with prefers-contrast, arrive as media queries, so the override is short.

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass-card {
    background: rgb(30, 41, 59);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

Safari does not expose the OS setting to CSS, so a page cannot react to it there, even though macOS and iOS both offer Reduce Transparency (MDN).

Make the default glass pass contrast on its own. Treat the preference query as an upgrade for browsers that support it, not as the safeguard.

The Altonet Fluid Glassmorphism plugin for WordPress follows this pattern, falling back to an opaque surface under either preference and to a semi-opaque one when backdrop-filter is unsupported.

Forced colors

In forced-colors mode the browser swaps background colors for a system color and removes shadows (cssence). The CSS Color Adjustment spec keeps the original alpha, though, so a translucent tint stays translucent over a busy photo.

That leaves the 1px border as the only visible edge (Superdesign), and Windows High Contrast Mode retains borders and outlines (Khan Academy Engineering).

  • Keep the border declared on every glass panel
  • Set an opaque Canvas background and backdrop-filter: none inside @media (forced-colors: active)
  • Emulate forced-colors in Chrome DevTools to confirm the edge survives

Does glassmorphism hurt performance?

It can, when the blurred area is large or sits over moving content.

Higher blur values cost more GPU time, and a full-width header costs more than a small card. Motion is the other big factor. Scrolling or animation behind the panel changes the backdrop, so the blur recomputes.

CSSmatic singles blur out as the priciest filter, fine for a few cards and risky for dozens of animated panels.

Used on one small pane, the cost is modest. web.dev describes the property as a performant way to get effects that were difficult or impossible on the web before.

On mobile, overuse can show up as dropped frames during scrolling.

A sticky navigation bar is the worst common case, because the whole page scrolls behind it.

Neither MDN nor web.dev publishes a ceiling for blurred elements per page. Any specific count is a number to test on your slowest target device.

Record a scroll in the Chrome DevTools Performance panel and look for frames that miss the 16.7 ms budget at 60 Hz. If they appear, cut the radius first, then the area, then the count.

When should you skip glassmorphism?

Skip it for dense reading text and for content that scrolls under the glass. Low-end mobile targets are another reason to hold back.

Use it for a few overlays over backgrounds you control, and keep solid surfaces everywhere else.

Where glass fits

  • A navigation bar works when the labels are short and the hero behind it is one you control.
  • Modal windows suit it, since they are transient surfaces sitting over the page.
  • A handful of cards over a gradient or photo is fine.
  • Login forms too, with a few short fields over a fixed image.

Apple’s WWDC25 guidance for Liquid Glass shows the same restraint: sparing use, mostly on navigation-layer buttons and key actions such as a buy button, as MobileSyrup summarized the session.

A login form built in CSS is the easiest place to try it, since it comes down to two short fields over a fixed image.

For modal windows, start from a CSS modal base and add the glass layer last.

Where it breaks down

  • Long paragraphs, tables and dense forms
  • Content that scrolls under the panel, where no single contrast ratio holds
  • Pages that stack many blurred panels over animated backdrops
  • Panel edges that cannot reach 3:1 against the backdrop

A page built mostly from glass has no stable surface left for reading.

CSS Glassmorphism FAQ

What is the difference between glassmorphism and neumorphism?

They get depth in different ways. Neumorphism builds it from a light and a dark shadow on an element that matches its background color, while glass builds it from blur over a varied backdrop. The neumorphism style needs a flat mid-tone surface, the one place glass shows nothing.

Both struggle at the edge: CodeShack notes a soft shadow can fall below 3:1 contrast.

Is Apple’s Liquid Glass the same as glassmorphism?

Not quite. Liquid Glass is Apple’s design language for iOS, iPadOS, macOS, watchOS and tvOS (Apple Newsroom), while glassmorphism is a style web designers rebuild with blur and a translucent fill.

Microsoft’s acrylic belongs to the same family, built from blur, exclusion blend, tint and noise layers (Microsoft Learn).

How do you build glassmorphism in Tailwind CSS?

Pair a translucent fill such as bg-white/30 with a backdrop-blur-* utility, the combination Tailwind’s docs use. Mind the version, though. backdrop-blur-sm is blur(4px) in v3 and blur(8px) in v4, so the same class blurs harder after an upgrade.

Does Figma support the glass effect?

It does. Figma’s Background blur effect blurs any layers behind the selected layer, and each layer takes one background blur (Figma Help).

Keep the fill partly transparent so the blur shows, then follow this walkthrough on blurring in Figma for the steps.

Does glassmorphism work in dark mode?

It does, with a different recipe. Dark glass uses a faint white fill and border over a deep base color instead of a strong tint.

Aimeos’s Pagible Glass theme sets about 9% white fill, about 25% white border and blur(20px) over #060A12, so run the text contrast check again against that backdrop.

Can a generator write all the CSS for you?

Only part of it. A generator writes the core declarations, and CSSmatic’s includes the -webkit- prefix.

Neither sees your real backdrop, so the contrast check and the @supports fallback stay your job.

Testing CSS Glassmorphism Before It Ships

Check contrast against the worst backdrop region first. After that, confirm the solid fallback under @supports, and finish by scrolling the page on the slowest device you target.

Contrast goes first because it fails on every browser, while the fallback matters only on older engines and the scroll test only on weaker hardware.

Passing the first check has a price: a higher fill alpha makes the pane read closer to a solid card.

The fallback check drops in priority after 2027-03-16, the date web-features expects backdrop-filter to reach Baseline Widely Available (verified October 2026).

Run the contrast pass against a full web accessibility checklist before the panel reaches users.