Materials

Two materials: soft plastic (default) and Liquid Glass. Every component has a glass version: controls become clear capsules, panels and boards become regular glass, after Apple's Liquid Glass guidance. Glass looks best over colour or a picture. It works with every palette.

Rice field

Ready in 2 minutes

Lv 4+14Rain
Plastic (default)
Rice field

Ready in 2 minutes

Lv 4+14Rain
data-material="glass"

Turn it on

For the whole app, or one section such as a game HUD or a hero:

<html data-material="glass" data-palette="lotus">

<!-- or one section, with a warm backdrop so the glass has something to show -->
<section data-material="glass" class="cz-glass-backdrop">…</section>

Inside a glass page, data-material="plastic" turns one area back to plastic.

Glass reads best over colour or a picture. cz-glass-backdrop paints soft palette-coloured light; any image or scene behind works too.

What changes

PartPlasticGlass
ControlsRaised blocks with a wallClear glass capsules: a light blur, a thin bright rim and a soft floating shadow (buttons, select, tabs, toggles, checkbox, radio, calendar days)
Prominent actionsColoured plasticTinted glass (primary, success, destructive, reward, secondary), and tinted glass badges
Panels and boardsPlastic boardsRegular glass: stronger blur and luminosity so text reads (cards, alerts, accordions, tables, calendar, dialogs, sheets, menus, popovers, toasts)
FieldsSunken wellsClear wells with a soft inner shadow (inputs, search, facets)
PressSinks into its wallSwells and brightens, like a drop

Readable by default

  • Tinted glass with light text is deepened first, dark palettes dim the glass instead of lightening it, and boards keep 72% of their colour, so every text pair passes WCAG AA in all five palettes, over the page and over the backdrop's colour pools (checked by pnpm contrast).
  • With prefers-reduced-transparency or prefers-contrast: more, glass turns solid and the blur is off.

Tune it

CSS
[data-material="glass"] {
  --cz-glass-fill: light-dark(rgb(255 255 255 / 0.2), rgb(12 10 20 / 0.28));
  --cz-glass-tint: 82%;   /* colour kept on tinted (prominent) glass */
  --cz-glass-board: 72%;  /* surface colour kept on dialogs, menus, sheets */
  --cz-glass-control-filter: blur(3px) saturate(1.8) brightness(1.06);
  --cz-glass-board-filter: blur(22px) saturate(1.8) brightness(1.04);
}

Lower values make the glass clearer but can drop text contrast; run your colours through a contrast check if you change them.