Design with frosted light, not flat color.
A design language for translucent interfaces: tokens, glass math, components and fallbacks for web, Tailwind and Figma. Everything below is live, built with the same CSS it documents.
Philosophy and core principles
Every surface is a sheet of frosted glass floating above a luminous environment. Hierarchy comes from blur, brightness, rim light and shadow instead of opaque color.
Frosted glass
Surfaces blur and tint what sits behind them.
Depth layers
Elevation is blur plus shadow plus brightness.
Light refraction
Light enters top-left and catches the glass edge.
Legibility first
Scrims and fallbacks keep content readable.
Layer model
| Tier | Role | Blur | Fill (dark) | Z-index |
|---|---|---|---|---|
| G0 Canvas | Background, spheres | none | n/a | 0 |
| G1 Surface | Nav, sidebars | 12px | 8–12% | 10 |
| G2 Raised | Cards, popovers | 20px | 12–16% | 20–40 |
| G3 Overlay | Modals, sheets | 32px | 18–24% | 50–60 |
| G4 Float | Tooltips, toasts, badges | 8–16px | 20–28% | 70–90 |
Light and dark
Dark mode uses white glass at 8–24%. Light mode needs roughly three times the fill (40–74% white), softer saturation (140–160%), indigo-tinted shadows and dark text. Use the toggle in the header to compare.
Backgrounds, lighting and color tokens
Glass needs something to refract: a base color, a gradient mesh and two to four blurred spheres partly hidden behind content.
Translucency tokens
| Token | Dark | Light | Use |
|---|---|---|---|
--glass-fill-subtle | white 6% | white 40% | Quiet panels |
--glass-fill-default | white 10% | white 52% | Cards, nav |
--glass-fill-strong | white 16% | white 64% | Raised cards |
--glass-fill-overlay | white 22% | white 74% | Modals |
--glass-scrim | navy 35% | indigo 8% | Text contrast tint |
Background recipe
.glass-canvas {
background-color: var(--canvas-base);
background-image:
radial-gradient(60% 50% at 15% 10%, hsla(262 90% 60% / .45), transparent 70%),
radial-gradient(50% 45% at 85% 20%, hsla(190 95% 55% / .35), transparent 70%),
radial-gradient(55% 50% at 60% 95%, hsla(330 90% 60% / .35), transparent 70%);
}
.sphere { position: absolute; border-radius: 9999px; filter: blur(60px); opacity: .55; }
The glass effect math
Raise blur before raising opacity. Saturation restores the color that blur averages away.
Core primitive with rim light
.glass {
position: relative; isolation: isolate;
background: var(--glass-fill-default);
-webkit-backdrop-filter: blur(16px) saturate(170%);
backdrop-filter: blur(16px) saturate(170%);
border-radius: 20px;
box-shadow:
inset 0 1px 0 hsla(0 0% 100% / .35), /* specular highlight */
0 8px 32px -4px hsla(262 70% 8% / .45), /* colored ambient shadow */
0 2px 6px hsla(262 70% 8% / .25); /* contact shadow */
}
.glass::before { /* gradient rim, brightest top-left */
content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
background: linear-gradient(135deg, hsla(0 0% 100% / .55), hsla(0 0% 100% / .12) 35%,
hsla(0 0% 100% / .04) 65%, hsla(0 0% 100% / .12));
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
-webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
Tailwind
relative isolate rounded-[20px] border border-white/20 bg-white/10 backdrop-blur-[16px] backdrop-saturate-[1.7] shadow-[0_8px_32px_-4px_hsla(262,70%,8%,.45)]
Typography and visibility
Inter for interface text, Plus Jakarta Sans for headings, JetBrains Mono for code. Body weight is 500, never below 400, never under 12px on glass.
Display48/52 · 700
Heading one36/42 · 700
Heading two28/34 · 650
Heading three22/28 · 600
Body copy sits at weight 500 so thin strokes survive blur.16/24 · 500
Caption and badge text12/16 · 600
Contrast techniques, in order
1. More blur
Diffusion flattens the luminance behind text before you touch opacity.
2. Scrim tint
Add --glass-scrim under text-heavy panels.
3. Weight boost
Add 100 to small text: 400 becomes 500.
4. Soft text shadow
0 1px 2px hsla(240 40% 4% / .35) anchors glyphs.
Interactive components
Try the states: hover, press and tab through them.
Buttons
Idle, hover glow, inset press, focus ring, disabled.
Inputs
Recessed glass with a cyan focus halo.
Tooltips and badges
Compact frosted surfaces with a darker tint.
Delete project?
This removes the project and its files. You can’t undo this.
Layering
| Layer | z-index | Blur |
|---|---|---|
| Surface (nav) | 10 | 12–16px |
| Cards | 20 | 16–20px |
| Dropdown, popover | 40 | 20–24px |
| Modal scrim | 50 | 8px on the page behind |
| Modal | 60 | 32–36px |
| Tooltip | 80 | 10–12px |
Never nest backdrop-filter inside another glass element; use a plain translucent fill instead.
Button CSS
.btn-glass { min-height: 44px; border-radius: 14px; background: var(--glass-fill-default);
-webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
box-shadow: inset 0 1px 0 hsla(0 0% 100% / .35), 0 4px 20px -2px hsla(262 70% 8% / .35); }
.btn-glass:hover { background: var(--glass-fill-strong); transform: translateY(-1px);
box-shadow: inset 0 1px 0 hsla(0 0% 100% / .45), 0 0 24px hsla(262 90% 62% / .55); }
.btn-glass:active { background: hsla(0 0% 100% / .05); transform: scale(.98);
box-shadow: inset 0 2px 8px hsla(240 40% 4% / .45); }
.btn-glass:focus-visible { outline: 2px solid hsl(190 95% 62%); outline-offset: 3px; }
Accessibility and fallbacks
Unsupported browsers get a more opaque surface, never an unreadable see-through one.
.glass { background: hsla(250 30% 16% / .92); } /* opaque default */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
.glass { background: var(--glass-fill-default); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
.glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: hsl(250 30% 16%); }
}
@media (prefers-reduced-motion: reduce) { .sphere { animation: none; } }
WCAG 2.1 guidance
| Criterion | Requirement | Glass guidance |
|---|---|---|
| 1.4.3 Contrast | 4.5:1 text, 3:1 large | Measure against the worst-case backdrop pixel, not the average |
| 1.4.11 Non-text contrast | 3:1 for component edges | Rim light alone usually fails; add a border or focus ring |
| 1.4.1 Use of color | Not color alone | Pair glow and tint with icons or text |
| 2.4.7 Focus visible | Visible keyboard focus | 2px cyan ring with offset |
| 2.2.2 Pause, stop, hide | Moving content can stop | Stop sphere drift for reduced motion |
Performance
Budget
About 3–4 blurred layers per mobile viewport. Animate only transform and opacity.
Lists
One glass container behind a list, plain translucent rows inside. Offer a manual Reduce transparency toggle.