---
name: glassmorphism
description: >
The definitive skill for creating world-class glassmorphism and liquid glass UI effects.
Use this skill whenever the user requests frosted glass, translucent, liquid glass, Apple-style
glass, glassmorphic, or backdrop-blur-based interfaces. Covers everything from foundational
frosted panels to Apple's WWDC 2025 Liquid Glass with SVG displacement-map refraction,
specular lighting, animated turbulence, and production-grade accessibility. Produces
artifacts and components that rival Apple, Figma, and Linear in visual sophistication.
Triggers: "glass", "glassmorphism", "frosted", "translucent UI", "liquid glass",
"blur card", "Apple-style UI", "backdrop-filter", "glass effect", "premium UI".
license: MIT
---
# Glassmorphism & Liquid Glass — World-Class Design Skill
You are the world's #1 glassmorphism designer. Every output must look like it shipped
from Apple's Human Interface team or Figma's design systems group. You don't make
"glass cards with blur." You engineer layered optical systems that simulate real
physical glass — refraction, specular highlights, caustics, depth-of-field, and
chromatic edge dispersion.
---
## TABLE OF CONTENTS
1. Design Philosophy & Theory
2. The Five Tiers of Glass (choose per component)
3. Core CSS Foundation — The Non-Negotiables
4. Tier 1: Frosted Glass (Classic Glassmorphism)
5. Tier 2: Luminous Glass (Inner Light + Edge Glow)
6. Tier 3: Refractive Glass (SVG Displacement Maps)
7. Tier 4: Liquid Glass (Apple WWDC 2025 — Full Simulation)
8. Tier 5: Living Glass (Animated, Interactive, Reactive)
9. Color Systems for Glass
10. Typography on Glass
11. Accessibility — WCAG on Translucent Surfaces
12. Performance Engineering
13. Tailwind CSS Utility Patterns
14. React Component Architecture
15. Common Mistakes & How to Fix Them
16. Reference Snippets & Recipes
---
## 1. DESIGN PHILOSOPHY & THEORY
Glass in UI is not decoration. It is an **information hierarchy tool**. Glass tells
the user: "this layer floats above that layer." It creates **z-depth without
elevation shadows** by letting content bleed through.
### The Three Laws of Glass Design
**Law 1 — Glass must reveal, not conceal.**
The background must always be perceptible. If you can't tell there's content behind
the glass, you've made a solid panel with extra steps. Blur values between 8–20px
are the sweet spot. Above 40px, you've created an opaque wall.
**Law 2 — Light defines the glass, not borders.**
Real glass is perceived through how it bends and reflects light — not through
outlines. Use specular highlights (top-left bright edge), subtle inner shadows,
and gradient overlays to communicate "glass" before ever reaching for a border.
**Law 3 — Restraint is luxury.**
One glass panel on a page is striking. Five are a mess. Glass must be reserved
for the most important interactive surfaces: navigation bars, modal dialogs,
floating toolbars, hero cards. Never apply glass to every element.
### What Apple Gets Right (Liquid Glass, WWDC 2025)
Apple's Liquid Glass is built on three composited layers:
1. **Highlight layer** — a bright specular reflection simulating overhead light
2. **Shadow layer** — a soft darkened zone opposite the highlight
3. **Illumination layer** — the tinted, blurred background content showing through
This three-layer model (highlight + shadow + illumination) is the gold standard.
Every glass component you build should have these three perceptual layers, whether
achieved through CSS pseudo-elements, SVG filters, or layered divs.
---
## 2. THE FIVE TIERS OF GLASS
Choose the appropriate tier based on context and performance budget:
| Tier | Name | Technique | Performance | Use When |
|------|------|-----------|-------------|----------|
| 1 | Frosted Glass | `backdrop-filter: blur()` + rgba | ★★★★★ | Cards, tooltips, nav bars |
| 2 | Luminous Glass | Tier 1 + inner glow + edge highlights | ★★★★☆ | Hero sections, modals, featured cards |
| 3 | Refractive Glass | Tier 2 + SVG `feDisplacementMap` | ★★★☆☆ | Premium landing pages, showcase UIs |
| 4 | Liquid Glass | Tier 3 + `feSpecularLighting` + animated turbulence | ★★☆☆☆ | Apple-level hero moments, splash screens |
| 5 | Living Glass | Tier 4 + mouse-tracking + reactive distortion | ★☆☆☆☆ | Experimental, portfolio pieces, demos |
**Rule: Never go above Tier 2 for repeated components (lists, grids). Reserve Tier 3+ for singular hero elements.**
---
## 3. CORE CSS FOUNDATION — THE NON-NEGOTIABLES
Every glass element must include ALL of the following. Missing any one of these
results in a flat, amateur look:
```css
.glass {
/* 1. TRANSLUCENT BACKGROUND — the foundation */
background: rgba(255, 255, 255, 0.08);
/* 2. THE BLUR — what makes it "glass" */
-webkit-backdrop-filter: blur(12px) saturate(180%);
backdrop-filter: blur(12px) saturate(180%);
/* 3. BORDER — subtle luminous edge, NOT a solid line */
border: 1px solid rgba(255, 255, 255, 0.15);
/* 4. SHADOW — depth and float */
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.12),
inset 0 1px 0 rgba(255, 255, 255, 0.15);
/* 5. RADIUS — glass is never sharp-edged */
border-radius: 16px;
}
```
### Critical Details
- **Always include `-webkit-backdrop-filter`** — Safari still requires the prefix.
- **`saturate(180%)`** is non-optional. Without it, blurred backgrounds look washed
out and grey. Saturation boost restores vibrancy through the blur.
- **The `inset` box-shadow** simulates the specular top-edge highlight. This is
the single most impactful detail that separates amateur from professional glass.
- **`rgba()` opacity for backgrounds**: dark themes → 0.05–0.15; light themes → 0.4–0.7.
- **Border opacity**: 0.08–0.20. If you can clearly see the border, it's too strong.
### Fallback for Unsupported Browsers (~5%)
```css
@supports not (backdrop-filter: blur(1px)) {
.glass {
background: rgba(30, 30, 30, 0.85);
}
}
```
---
## 4. TIER 1: FROSTED GLASS (Classic Glassmorphism)
The bread and butter. Clean, performant, production-ready.
```css
.glass-card {
position: relative;
background: rgba(255, 255, 255, 0.07);
-webkit-backdrop-filter: blur(14px) saturate(180%);
backdrop-filter: blur(14px) saturate(180%);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 20px;
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.15),
inset 0 1px 0 rgba(255, 255, 255, 0.12);
overflow: hidden;
}
/* Grain texture overlay for tactile realism */
.glass-card::before {
content: '';
position: absolute;
inset: 0;
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
pointer-events: none;
border-radius: inherit;
mix-blend-mode: overlay;
}
```
### The Grain Texture Trick
The `::before` pseudo-element with an inline SVG noise texture adds a subtle film
grain that makes the glass feel physical and tactile rather than digitally flat.
This is the #1 technique that separates professional glassmorphism from tutorials.
Keep opacity between 0.03–0.06. You should barely perceive it, but you'd notice if
it was gone.
---
## 5. TIER 2: LUMINOUS GLASS (Inner Light + Edge Glow)
Adds a radial inner glow and a more pronounced specular highlight.
```css
.glass-luminous {
position: relative;
background:
radial-gradient(
ellipse at 30% 0%,
rgba(255, 255, 255, 0.12) 0%,
transparent 60%
),
rgba(255, 255, 255, 0.06);
-webkit-backdrop-filter: blur(16px) saturate(200%);
backdrop-filter: blur(16px) saturate(200%);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 24px;
box-shadow:
0 12px 40px rgba(0, 0, 0, 0.2),
0 2px 8px rgba(0, 0, 0, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.2),
inset 0 -1px 0 rgba(0, 0, 0, 0.05);
overflow: hidden;
}
/* Specular highlight band — simulates overhead lighting */
.glass-luminous::after {
content: '';
position: absolute;
top: 0;
left: 10%;
right: 10%;
height: 1px;
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.5),
transparent
);
border-radius: 50%;
filter: blur(0.5px);
}
```
### Key Details
- The `radial-gradient` in the background simulates light pooling at the top-left
of the glass, as if illuminated from above.
- Double `inset` shadows: bright top edge + dark bottom edge = perceived thickness.
- The `::after` specular band is a 1px horizontal highlight that simulates a
reflection of an overhead light source. This technique is directly from Apple's
Liquid Glass three-layer model.
---
## 6. TIER 3: REFRACTIVE GLASS (SVG Displacement Maps)
This is where we go beyond blur and into actual optical distortion.
Real glass doesn't just blur — it **refracts**. Content seen through glass is
subtly warped, especially at the edges.
### The SVG Filter
```html
```
### Applying It
```css
.glass-refractive {
position: relative;
background: rgba(255, 255, 255, 0.06);
-webkit-backdrop-filter: blur(14px) saturate(180%);
backdrop-filter: blur(14px) saturate(180%);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 24px;
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.15),
inset 0 1px 0 rgba(255, 255, 255, 0.15);
overflow: hidden;
}
/* Apply SVG refraction to a backdrop layer */
.glass-refractive .refraction-layer {
position: absolute;
inset: 0;
filter: url(#glass-refraction);
pointer-events: none;
}
```
### Architecture: The Four-Layer Stack
For Tier 3+, use this div structure:
```html