Skip to content
UIGlass

Prism Play Icon

Play control with chromatic edges and a cyan glow.

CSS
/* UIGlass · liquid glass icon button · uiglass.com */
/* NOTE — these styles are NOT the whole component.
   This look uses an SVG filter, so you also need:
     1) the component markup (the HTML tab),
     2) the <svg> filter defs + the browser-support script (also in the HTML tab).
   Copy the HTML tab, or download the full HTML page, to get everything at once. */
.glass-icon {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
  border: 0;
  font-family: inherit;
  line-height: 1.2;
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 32px;
  width: 64px;
  height: 64px;
  font-size: 24px;
  color: rgb(255 255 255 / 0.96);
  text-shadow: 0 1px 3.5px rgb(0 0 0 / 0.1);
  background-color: rgb(255 255 255 / 0.08);
  --lg-backdrop: blur(4px) saturate(160%) brightness(106%);
  box-shadow: inset 1.06px 1.06px 1px -0.5px rgb(255 255 255 / 0.595),
    inset 0 0 0 0.5px rgb(255 255 255 / 0.196),
    inset -1.41px -1.41px 2px -1px rgb(255 255 255 / 0.22),
    inset 5.66px 5.66px 16px -8px rgb(255 255 255 / 0.21),
    inset -7.07px -7.07px 18px -10px rgb(0 0 0 / 0.121),
    0 1.7px 4.1px rgb(0 0 0 / 0.077),
    0 8.9px 21.9px -4px rgb(0 0 0 / 0.112),
    0 0 24px rgb(126 166 255 / 0.3);
  --lg-rim-angle: 135deg;
  --lg-rim-a: rgb(255 255 255 / 0.63);
  --lg-rim-b: rgb(255 255 255 / 0.24);
  --lg-rim-w: 1px;
  opacity: 1;
  transform: none;
  -webkit-backdrop-filter: var(--lg-backdrop);
  backdrop-filter: var(--lg-backdrop);
  transition: transform 260ms cubic-bezier(.34,1.56,.64,1),
    box-shadow 260ms cubic-bezier(.22,1,.36,1),
    background-color 260ms cubic-bezier(.22,1,.36,1),
    color 260ms cubic-bezier(.22,1,.36,1),
    opacity 260ms cubic-bezier(.22,1,.36,1),
    backdrop-filter 260ms cubic-bezier(.22,1,.36,1),
    -webkit-backdrop-filter 260ms cubic-bezier(.22,1,.36,1),
    border-radius 260ms cubic-bezier(.22,1,.36,1);
}

.glass-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  padding: var(--lg-rim-w);
  background: linear-gradient(var(--lg-rim-angle), var(--lg-rim-a), transparent 46%, transparent 54%, var(--lg-rim-b));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.glass-icon::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 0.35) 50%, transparent 65%);
  transform: translateX(-135%);
  transition: transform 750ms cubic-bezier(.22,1,.36,1);
}

.glass-icon:hover::after,
.glass-icon:focus-visible::after {
  transform: translateX(135%);
}

.glass-icon > * {
  position: relative;
  z-index: 1;
}

.glass-icon svg {
  width: 1em;
  height: 1em;
  flex: none;
}

.glass-icon:hover,
.glass-icon:focus-visible {
  box-shadow: inset 1.06px 1.06px 1px -0.5px rgb(255 255 255 / 0.722),
    inset 0 0 0 0.5px rgb(255 255 255 / 0.238),
    inset -1.41px -1.41px 2px -1px rgb(255 255 255 / 0.22),
    inset 5.66px 5.66px 16px -8px rgb(255 255 255 / 0.27),
    inset -7.07px -7.07px 18px -10px rgb(0 0 0 / 0.121),
    0 1.7px 4.1px rgb(0 0 0 / 0.077),
    0 8.9px 21.9px -4px rgb(0 0 0 / 0.112),
    0 0 24px rgb(126 166 255 / 0.3);
  --lg-rim-a: rgb(255 255 255 / 0.765);
  transform: translateY(-1.5px) scale(1.05);
}

.glass-icon:active {
  box-shadow: inset 1.06px 1.06px 1px -0.5px rgb(255 255 255 / 0.722),
    inset 0 0 0 0.5px rgb(255 255 255 / 0.238),
    inset -1.41px -1.41px 2px -1px rgb(255 255 255 / 0.22),
    inset 5.66px 5.66px 16px -8px rgb(255 255 255 / 0.27),
    inset -7.07px -7.07px 18px -10px rgb(0 0 0 / 0.121),
    0 1.7px 4.1px rgb(0 0 0 / 0.077),
    0 8.9px 21.9px -4px rgb(0 0 0 / 0.112),
    0 0 24px rgb(126 166 255 / 0.3);
  --lg-rim-a: rgb(255 255 255 / 0.765);
  transform: translateY(0px) scale(0.94);
}

.glass-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.28), 0 0 16px 3px rgb(255 255 255 / 0.5),
    inset 1.06px 1.06px 1px -0.5px rgb(255 255 255 / 0.722),
    inset 0 0 0 0.5px rgb(255 255 255 / 0.238),
    inset -1.41px -1.41px 2px -1px rgb(255 255 255 / 0.22),
    inset 5.66px 5.66px 16px -8px rgb(255 255 255 / 0.27),
    inset -7.07px -7.07px 18px -10px rgb(0 0 0 / 0.121),
    0 1.7px 4.1px rgb(0 0 0 / 0.077),
    0 8.9px 21.9px -4px rgb(0 0 0 / 0.112),
    0 0 24px rgb(126 166 255 / 0.3);
}

/* SVG liquid-glass filter (Chromium). Other browsers keep the frosted fallback above. */
.lg-refract .glass-icon {
  backdrop-filter: url(#glass-icon-fx) var(--lg-backdrop);
}

@media (prefers-reduced-motion: reduce) {
  .glass-icon,
  .glass-icon::after {
    transition: none;
  }
  .glass-icon::after {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass-icon {
    background-color: rgb(22 24 30 / 0.92);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-icon {
    background-color: rgb(22 24 30 / 0.92);
  }
}
HTML
<!-- UIGlass icon button · uiglass.com -->
<!-- Paste the CSS from the CSS tab too. The <svg> defs + script below go once per page. -->
<button class="glass-icon" type="button" aria-label="Play"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 5.2v13.6a.8.8 0 0 0 1.2.7l10.6-6.8a.8.8 0 0 0 0-1.4L9.2 4.5A.8.8 0 0 0 8 5.2z"/></svg></button>
<!-- SVG refraction filter: include once per page -->
<svg class="lg-defs" width="0" height="0" style="position:absolute;width:0;height:0;overflow:hidden" aria-hidden="true" focusable="false"><defs><filter id="glass-icon-fx" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox" color-interpolation-filters="sRGB"><feImage href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='x'%3E%3Cstop offset='0' stop-color='rgb(0,0,0)'/%3E%3Cstop offset='1' stop-color='rgb(255,0,0)'/%3E%3C/linearGradient%3E%3ClinearGradient id='y' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(0,0,0)'/%3E%3Cstop offset='1' stop-color='rgb(0,255,0)'/%3E%3C/linearGradient%3E%3Cfilter id='b' x='-50%25' y='-50%25' width='200%25' height='200%25'%3E%3CfeGaussianBlur stdDeviation='7.5'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='64' height='64' fill='rgb(128,128,0)'/%3E%3Crect width='64' height='64' rx='32' fill='url(%23x)'/%3E%3Crect width='64' height='64' rx='32' fill='url(%23y)' style='mix-blend-mode:screen'/%3E%3Crect x='20' y='20' width='24' height='24' rx='12' fill='rgb(128,128,128)' filter='url(%23b)'/%3E%3C/svg%3E" x="0" y="0" width="1" height="1" preserveAspectRatio="none" result="pmap"/><feDisplacementMap in="SourceGraphic" in2="pmap" scale="-0.34375" xChannelSelector="R" yChannelSelector="G" result="dr"/><feColorMatrix in="dr" values="1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" result="cr"/><feDisplacementMap in="SourceGraphic" in2="pmap" scale="-0.5" xChannelSelector="R" yChannelSelector="G" result="dg"/><feColorMatrix in="dg" values="0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0" result="cg"/><feDisplacementMap in="SourceGraphic" in2="pmap" scale="-0.65625" xChannelSelector="R" yChannelSelector="G" result="db"/><feColorMatrix in="db" values="0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0" result="cb"/><feBlend in="cr" in2="cg" mode="screen" result="rg"/><feBlend in="rg" in2="cb" mode="screen" result="disp"/></filter></defs></svg>
<script>/* UIGlass: SVG backdrop refraction is supported by Chromium engines only */(function(){var n=navigator,b=n.userAgentData&&n.userAgentData.brands;if((b&&b.some(function(x){return/Chromium/.test(x.brand)}))||(window.chrome&&!/Firefox|FxiOS|CriOS|EdgiOS|OPiOS/.test(n.userAgent)))document.documentElement.classList.add("lg-refract")})();</script>

Similar presets