Glass
Frosted glass surfaces communicate spatial depth — a panel floats above content, a modal floats above the page. Every glass level pairs blur, saturation, opacity, and a hairline border.
Variants
Five glass variants ordered by elevation. Each preview renders the surface over the brand gradient so the frosting effect is always visible.
The strongest glass level. Used for command palettes, sheets, and full-screen overlays.
High-fidelity frosting for persistent chrome. Sits between content and the edge of the viewport.
Lighter blur for persistent sidebars and panels. Keeps content behind subtly readable.
Low-opacity glass for inline controls. The content behind remains clearly legible.
Brand-coloured glass for primary actions. The accent hue tints the frosting.
Properties
backdrop-filter: blur()10pxPanel12pxGhost / Accent16pxChrome20pxOverlay
Controls how much the content beneath is blurred. Higher values create denser frosting at the cost of GPU compositing.
backdrop-filter: saturate()150%Ghost160%Panel / Accent180%Chrome / Overlay
Boosts color saturation of the blurred content below. Prevents glass from looking washed-out — always paired with blur.
background-color opacity72%Ghost85%Chrome90%Accent92%Overlay100%Panel
The fill opacity of the surface token. Lower values let more background bleed through the frosting.
border1px solid rgb(var(--border-subtle))Low-contrast contexts1px solid rgb(var(--border))Standard glass edge1px solid rgb(var(--accent) / 0.45)Accent glass
A hairline border defines the glass edge against blurred content. Without it the surface dissolves into the background.
Rules
Frosted glass only communicates spatial meaning when there is real content behind it. A glass card over a flat colour is a lie — use a solid surface instead.
Content → Surface → Panel → Chrome → Overlay. Each layer uses a stronger blur than the one beneath it. Never apply a stronger glass variant lower in the stack.
backdrop-filter forces the browser to composite every layer beneath it. Limit glass surfaces to persistent chrome and infrequent overlays. Never animate blur values.
Without a hairline border the glass edge dissolves into the background. The border is not decoration — it is the surface definition.
blur() alone drains colour from the background. saturate() restores it. The two are always paired — removing one makes the glass look washed out or unnaturally vivid.
backdrop-filter is not universally supported. Always pair it with a solid background-color so the surface remains legible when the effect drops out.
Specular overlays
Liquid Glass adds four specular layers on top of the base frosted surface. Each one mimics a different physical light-interaction — an edge highlight, a brand tint, a pill gloss, and a colour strip sheen. These are the web equivalents of Warren's Swift surface modifiers.
sfSpecularTopEdgeSwift: sfSpecularTopEdge1 px hairline highlight on the top edge of any glass surface. Communicates that light is hitting the surface from above. Applied via box-shadow so it doesn't require a pseudo-element.
box-shadow: inset 0 1px 0 rgba(255,255,255,0.10)sfBrandLitSurfaceSwift: sfBrandLitSurfaceSubtle accent tint applied to glass surfaces that are 'lit' by the brand colour — e.g. the active state of a navigation item, a selected card, or a goal-met streak card. Pairs with a matching accent border at 0.25 opacity.
background: rgb(var(--accent) / 0.06)sfPillSpecularSwift: sfPillSpecularStronger top-edge specular for pill-shaped controls — badges, tags, segmented buttons. The outer ring at 2px provides a subtle selection halo. Both shadows collapse to a single box-shadow declaration.
box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 0 0 2px rgba(0,0,0,0.12)sfColorStripSheenSwift: sfColorStripSheenA translucent gradient strip that fades from the surface's accent colour to transparent, running left-to-right across the top of a card. Used in Gantt bars, Kanban column headers, and progress indicators.
background: linear-gradient(to right, var(--color), transparent)Reduced transparency
When the user has enabled "Reduce Transparency" in their OS accessibility settings, glass effects must fall back to solid surfaces. Both CSS and SwiftUI expose this preference — always handle it.
.glass-surface {
backdrop-filter: blur(20px) saturate(160%);
background: rgb(var(--surface) / 0.85);
}
@media (prefers-reduced-transparency) {
.glass-surface {
backdrop-filter: none;
background: rgb(var(--surface));
}
}// Warren uses .ultraThinMaterial with a conditional override
var backgroundMaterial: some ShapeStyle {
UIAccessibility.isReduceTransparencyEnabled
? AnyShapeStyle(Color.sfSurface)
: AnyShapeStyle(.ultraThinMaterial)
}
// In a view:
.background(backgroundMaterial)Testing tip — Enable "Increase Contrast" + "Reduce Transparency" in macOS System Settings → Accessibility → Display, or toggle prefers-reduced-transparency: reduce in Chrome DevTools → Rendering → Emulate CSS media feature.