Skip to content

Material & theming

One optical system drives every component. Three engines decide how the backdrop is treated; four materials set the weight; tokens make all of it yours.

Engines

The engine is resolved before first paint and carried as data-glass-engine on <html>. All differences live in CSS — components never branch on it.

EngineBackdrop treatmentWhen
refractSVG displacement refraction + blur + saturation in one backdrop passDetected compositor support
frostTuned blur, saturation, and brightness with the same specular detailsEverywhere else; also the no-JS baseline
solidOpaque surfaces, ring intact, zero transparencyprefers-reduced-transparency, or by choice

Force an engine for testing with ?glass=frost, ?glass=solid, or ?glass=refract; the choice persists until ?glass=auto clears it.

Materials

MaterialFrost blurUsed for
film8pxHairline chrome — badges, tooltips, dock icons
pane16pxInteractive chrome — buttons, alerts, panels
slab28pxRaised surfaces — cards, docks, toasts
veil44pxOverlay scale — dialogs, sheets, menus (frost-only by policy)

Per-instance overrides

Every knob is a custom property. Override them with arbitrary properties in your class list or inline styles:

<Glass
  material="pane"
  className="[--glass-tint-a:0.4] [--glass-tint-c:var(--success)]"
>
  Custom-tinted glass
</Glass>
TokenControls
--glass-blurBackdrop blur radius for the frost stack
--glass-tint-cTint color of the surface
--glass-tint-aTint opacity (0–1); transitions smoothly
--glass-refracturl(#…) of the refraction filter (managed per geometry in the refract engine)
--glass-depthMaximum bend at the rim, px (exact optics)
--glass-curveBevel profile exponent — soft shoulder to hard rim
--glass-chromaRGB split at the rim, 0–1
--glass-specIn-filter glint strength, 0–1
--glass-saturateBackdrop saturation boost
--glass-edge / --glass-edge-softSpecular ring, lit and shaded ends
--glass-sheenPointer-following highlight color
--glass-radiusSurface corner radius

Nesting

Glass inside glass automatically laminates: the inner surface keeps its tint and specular ring but drops its backdrop filter. Stacked blur reads as mush and costs twice — the system simply does not allow it.