Theming

Glass is a handful of CSS custom properties. Set them on the root to change every surface, or on any element to change the glass inside it.

Material tokens

PropertyDefaultEffect
--liquid-blur20pxBackdrop blur behind glass.
--liquid-tint0.22Opacity of the glass fill.
--liquid-fill255 255 255Fill color as RGB channels.
--liquid-ink#172323Text and icons on glass.
--liquid-accent#155dfcProminent buttons and labels under a lens.
--liquid-lens-inkthe accentLabels under a lens only.
--liquid-viscosity0.5Spring feel, from 0 (firm, bouncy) to 1 (slow, soft).
--liquid-morph-duration520msHow long a menu takes to form.

Menus and toasts render in a portal at the end of the page, so give them their values on the root element.

globals.css
:root {
  --liquid-blur: 28px;
  --liquid-tint: 0.3;
  --liquid-viscosity: 0.3;
}

Try them

These controls set the same properties on this page’s root.

All your moments.
20 px
22%
35%

Accent and lens

--liquid-accent colors prominent buttons and the labels under a lens. To keep lens labels neutral while buttons stay tinted, point the lens at the ink:

:root {
  --liquid-accent: #ff375f;
}

.filters {
  --liquid-lens-ink: var(--liquid-ink);
}

Dark material

Glass inside an element with the dark class, the shadcn convention, or with data-liquid-theme="dark" turns dark: a charcoal fill, white ink, and a brighter lens so labels stay legible.

<html className="dark">
  …
</html>

<section data-liquid-theme="dark">
  <Toolbar aria-label="Playback">…</Toolbar>
</section>

Opaque glass

When someone asks for less transparency or more contrast in their system settings, glass becomes an opaque fill with no blur. To do the same for part of a page, set data-reduced-transparency="true" on an ancestor.