Theming
109 primitives in 11 groups. Pick presets, turn any knob, theme a single card — all with CSS variables.
Every primitive as a control, a hue-harmony generator, a live preview, and export as a one-line shadcn CLI install, CSS, a shadcn item or a link.
How it works
The glass-style foundation adds primitives to :root and .dark. Everything you see — the frost, the rim, the shadow, the corners, the control heights — is computed from them on the element that uses them. So a primitive can be overridden anywhere, and only that subtree changes:
<Card className="[--glass-blur:6px] [--glass-opacity:70%]">Less blur, more frost</Card>
<Button className="[--glass-radius-button:0.5rem]">Squarer</Button>
<section className="[--glass-density:0.85]">…everything inside is compact</section>Presets compose
Each preset is a shadcn theme item that sets only its own group, so you mix them: a palette, a material, a shape, a motion, a density. Adding one replaces the previous choice in its group.
pnpm dlx shadcn@latest add https://glasscn.app/r/theme-lagoon.json https://glasscn.app/r/material-vivid.json https://glasscn.app/r/shape-soft.jsonPalettes
theme-systemtheme-dusktheme-oceantheme-rosetheme-sagetheme-ambertheme-graphitetheme-lavendertheme-minttheme-cherrytheme-lagoontheme-sandtheme-midnightMaterials
Shapes
Motion
Density
At runtime
The engine (glass-theme) builds themes in code — any hue and harmony, presets, overrides per scheme — and ThemeScope applies one to a subtree. Values are sanitised before they become CSS, so a theme from a share link can’t inject anything.
pnpm dlx shadcn@latest add https://glasscn.app/r/theme-scope.jsonimport { ThemeScope } from "@/components/glass/theme-scope"
import { createGlassTheme } from "@/lib/glass-theme"
const brand = createGlassTheme({
palette: { hue: 200, harmony: "triadic", chroma: 0.18 },
material: "vivid",
shape: "soft",
density: "compact",
tokens: { "glass-blur": "20px" },
dark: { "glass-glow": "24%" },
})
<ThemeScope theme={brand}>…</ThemeScope>Every primitive
Colour
--primaryButtons, selection, rings, the first chart colour.oklch(0.543 0.187 256.2)--primary-foregroundText and icons on the accent.oklch(1 0 none)--ringKeyboard focus outlines.oklch(0.543 0.187 256.2)--chart-1First data series (rings, sparklines).oklch(0.543 0.187 256.2)--chart-2Second data series.oklch(0.73 0.194 147.4)--chart-3Third data series.oklch(0.753 0.172 55.7)--chart-4Fourth data series.oklch(0.622 0.263 322.5)--chart-5Fifth data series.oklch(0.65 0.238 17.9)--chart-6Sixth data series — darker, so it parts from its neighbours by lightness as well as hue.oklch(0.559 0.23 279.3)--chart-7Seventh data series — lighter.oklch(0.745 0.127 203.3)--chart-8Eighth series and "Other" — a near-neutral.oklch(0.648 0.007 286.2)--aurora-1Top-left blob.oklch(0.963 0.007 286.3)--aurora-2Right blob.oklch(0.963 0.007 286.3)--aurora-3Bottom blob.oklch(0.963 0.007 286.3)--successDone, kept, connected.oklch(0.52 0.143 150)--success-foregroundText on a success fill.oklch(0.99 0 0)--warningNeeds attention.oklch(0.8 0.16 80)--warning-foregroundText on a warning fill.oklch(0.2 0.04 80)--infoNeutral news.oklch(0.52 0.089 205)--info-foregroundText on an info fill.oklch(0.99 0 0)--aurora-baseThe page colour under the aurora.oklch(0.963 0.007 286.3)Material
--glass-tintThe colour of the pane itself.oklch(1 0 0)--glass-opacityHow opaque a default pane is.52%--glass-opacity-strongDialogs, menus, popovers, the header.74%--glass-opacity-subtleCode blocks, previews, quiet panes.28%--glass-opacity-thickThe fourth standard material tier; web tuning, not Apple's private opacity.86%--glass-blurHow much the backdrop is blurred.28px--glass-saturateHow vivid the colour behind stays.180%--glass-brightnessLighten or darken what shows through.100%--glass-sheenA specular gradient across the pane.0%--glass-sheen-angleWhere the light comes from.160deg--glass-textureA noise texture laid over the frost.none--glass-fill-tintInputs, tracks, idle pills on glass.oklch(0.575 0.012 286)--glass-fill-opacityHow strong control fills are.12%--glass-fill-opacity-strongHovered and pressed fills, tracks.20%--glass-thumbThe raised thumb of segmented controls.oklch(1 0 0)--glass-labelText inside panes (remaps --foreground there).oklch(0 0 none)--glass-clarity0 ultra clear → 1 fully tinted, like iOS 27's Liquid Glass slider. Scales every frost.0.5--glass-label-secondaryMuted text inside panes (remaps --muted-foreground there).oklch(0.37 0.012 286)--glass-label-tertiaryPlaceholders and unavailable items inside panes.oklch(0.52 0.01 286)--glass-ink-strengthHow much of the accent or destructive colour plain tinted text on glass carries (text buttons, links, destructive menu choices); the rest is the label colour. Dark glass needs less to stay legible.75%--glass-label-quaternaryWatermarks inside panes.oklch(0.76 0.005 285)--glass-separator-opacityHairlines between rows, inside panes.12%--glass-knobSwitch and slider knobs.oklch(1 0 0)Liquid
--glass-liquid-opacityglasscn's regular-glass diffusion. These values approximate the 27 material, not Apple's private constants.58%--glass-liquid-clear-opacityClear glass over media. Dim bright media behind it only when needed.10%--glass-liquid-clear-dimSuggested dim for bright media behind clear controls. Apply to the media, and omit for dark or already dimmed content.35%--glass-liquid-blurglasscn's diffusion radius for complex content behind regular glass.18px--glass-liquid-clear-blurLight diffusion over media. A web approximation of the clear system material.4px--glass-liquid-saturateColour carried through liquid glass.160%--glass-refractionMaximum edge displacement in pixels. Requires GlassEffects; 0 disables. Apple's native shader chooses its own optics.14px--glass-bezelWidth of the rounded refracting edge.12px--glass-depth-opacityAdditional web frost as regular glass grows. Native chooses its own thickness.12%--glass-depth-blurAdditional web diffusion on large regular controls.6px--glass-inactive-strengthRemaining web rim and shadow strength when its window is inactive.0.4Rim
--glass-border-colorThe edge around content panes. Liquid Glass draws it only under Increase Contrast or Show control borders.oklch(1 0 0)--glass-border-opacityHow visible the edge is.85%--glass-border-widthEdge thickness.1px--glass-highlight-opacityThe inset top edge catching light.92%--glass-highlight-colorThe colour of rims, speculars and the press glow.oklch(1 0 0)--glass-light-angleWhere the virtual light comes from: the lit side of a liquid rim (-45deg = top left).-45deg--glass-specularRim highlight strength on the lit side of liquid glass.88%--glass-edge-shadeThe darkened inner edge on the shadow side (iOS 27).22%--glass-illuminationThe glow that spreads from the finger when liquid glass is pressed.22%Depth
--glass-shadow-colorColour of the drop shadow.oklch(0 0 0)--glass-shadow-opacityDrop shadow strength.12%--glass-shadow-yHow far below the pane the shadow falls.10px--glass-shadow-blurHow soft the shadow is.30px--glass-dimThe scrim behind dialogs and sheets.15%--glass-shadow-over-contentHow much deeper a bar's shadow gets while content scrolls under it.1.6--glass-glowAn accent glow inside every pane.0%Shape
--glass-radius-surfaceCards, dialogs, sheets, panes.1.5rem--glass-radius-controlInputs, menus, segmented controls.0.75rem--glass-radius-buttonButtons, tabs, the dock. 9999px is a capsule.capsule--glass-radius-badgeBadges and tags.capsule--glass-ring-widthKeyboard focus outline thickness (never below 2px).3pxDensity
--glass-hit-minThe smallest tap area on touch screens (Apple: 44pt).44px--glass-densityScales control heights, paddings and card spacing.1Motion
--glass-durationBase transition length.200ms--glass-easeThe curve every transition follows.spring--glass-press-scaleHow far buttons squash when pressed.0.97--glass-press-stretchElastic asymmetry on press: wider and shorter, springing back.0.04--glass-press-growLiquid glass grows when pressed (solid controls squash instead).1.04--glass-knob-lens-scaleHow much a switch, slider or segment knob grows into a lens while held.1.15Aurora
--aurora-opacityOpacity of the blobs.100%--aurora-scaleBlob size multiplier.1--aurora-speedDrift speed multiplier.1--aurora-blurExtra blur on the blobs.0pxFonts
--glass-font-sansText on glass. Unset: your app's --font-sans.app font--glass-font-headingTitles and headings. Unset: your app's --font-heading.app font--glass-font-displayBig figures: stats, rings, Display. Unset: the heading font.app font--glass-font-monoCode and keycaps. Unset: your app's --font-mono.app fontType
--glass-text-scaleMultiplies every step of the type scale (1 = 16px).1--glass-type-ratioHow fast headings grow, step to step.major third--glass-leadingBody text line height.1.6--glass-trackingBody text letter spacing.0em--glass-body-weightBody text weight.400--glass-heading-weightCard, dialog and sheet titles; headings.650--glass-heading-trackingLetter spacing of titles and headings.-0.015em--glass-heading-leadingLine height of titles and headings.1.15--glass-heading-caseText transform for titles and headings.as written--glass-heading-wrapBalance lines, avoid orphans, or wrap normally.balance--glass-hyphensHyphenate body text and prose (needs a lang attribute on the page).off (manual)--glass-display-weightBig figures: stats, rings, Display.700--glass-display-trackingLetter spacing of big figures.-0.03em--glass-numericFigures in stats, rings and tables.tabular--glass-font-featuresfont-feature-settings for body and headings.default--glass-measureMax line length of long-form text (Prose, Text lead).68ch--glass-underline-offsetLink underline distance.0.22emUtilities
glass, glass-strong, glass-subtle for surfaces; colours bg-glass, bg-fill, border-glass-border, bg-aurora-1…; corners rounded-surface, rounded-control, rounded-button, rounded-badge; sizing h-control, px-pad; motion ease-glass; type type-glass-heading, type-step-* (see Fonts & type). Two hooks replace whole layers: --glass-bg and --glass-elevation. No backdrop-filter? Panes go nearly opaque. prefers-reduced-motion stills the aurora and the charts.
:root {
--aurora-1: oklch(0.963 0.007 286.3);
--aurora-2: oklch(0.963 0.007 286.3);
--aurora-3: oklch(0.963 0.007 286.3);
--success: oklch(0.52 0.143 150);
--success-foreground: oklch(0.99 0 0);
--warning: oklch(0.8 0.16 80);
--warning-foreground: oklch(0.2 0.04 80);
--info: oklch(0.52 0.089 205);
--info-foreground: oklch(0.99 0 0);
--aurora-base: oklch(0.963 0.007 286.3);
--glass-tint: oklch(1 0 0);
--glass-opacity: 52%;
--glass-opacity-strong: 74%;
--glass-opacity-subtle: 28%;
--glass-opacity-thick: 86%;
--glass-blur: 28px;
--glass-saturate: 180%;
--glass-brightness: 100%;
--glass-sheen: 0%;
--glass-sheen-angle: 160deg;
--glass-texture: none;
--glass-fill-tint: oklch(0.575 0.012 286);
--glass-fill-opacity: 12%;
--glass-fill-opacity-strong: 20%;
--glass-thumb: oklch(1 0 0);
--glass-label: oklch(0 0 none);
--glass-clarity: 0.5;
--glass-label-secondary: oklch(0.37 0.012 286);
--glass-label-tertiary: oklch(0.52 0.01 286);
--glass-ink-strength: 75%;
--glass-label-quaternary: oklch(0.76 0.005 285);
--glass-separator-opacity: 12%;
--glass-knob: oklch(1 0 0);
--glass-liquid-opacity: 58%;
--glass-liquid-clear-opacity: 10%;
--glass-liquid-clear-dim: 35%;
--glass-liquid-blur: 18px;
--glass-liquid-clear-blur: 4px;
--glass-liquid-saturate: 160%;
--glass-refraction: 14px;
--glass-bezel: 12px;
--glass-depth-opacity: 12%;
--glass-depth-blur: 6px;
--glass-inactive-strength: 0.4;
--glass-border-color: oklch(1 0 0);
--glass-border-opacity: 85%;
--glass-border-width: 1px;
--glass-highlight-opacity: 92%;
--glass-highlight-color: oklch(1 0 0);
--glass-light-angle: -45deg;
--glass-specular: 88%;
--glass-edge-shade: 22%;
--glass-illumination: 22%;
--glass-shadow-color: oklch(0 0 0);
--glass-shadow-opacity: 12%;
--glass-shadow-y: 10px;
--glass-shadow-blur: 30px;
--glass-dim: 15%;
--glass-shadow-over-content: 1.6;
--glass-glow: 0%;
--glass-radius-surface: 1.5rem;
--glass-radius-control: 0.75rem;
--glass-radius-button: 9999px;
--glass-radius-badge: 9999px;
--glass-hit-min: 44px;
--glass-density: 1;
--glass-duration: 200ms;
--glass-ease: linear(0, 0.028, 0.098, 0.194, 0.302, 0.415, 0.523, 0.624, 0.713, 0.79, 0.855, 0.908, 0.949, 0.98, 1.003, 1.019, 1.029, 1.034, 1.036, 1.036, 1.034, 1.03, 1.026, 1.022, 1.018, 1.015, 1.011, 1.008, 1.006, 1.004, 1.002, 1.001, 1, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 1);
--glass-press-scale: 0.97;
--glass-press-stretch: 0.04;
--glass-press-grow: 1.04;
--glass-knob-lens-scale: 1.15;
--aurora-opacity: 100%;
--aurora-scale: 1;
--aurora-speed: 1;
--aurora-blur: 0px;
--glass-ring-width: 3px;
--glass-text-scale: 1;
--glass-type-ratio: 1.25;
--glass-leading: 1.6;
--glass-tracking: 0em;
--glass-body-weight: 400;
--glass-heading-weight: 650;
--glass-heading-tracking: -0.015em;
--glass-heading-leading: 1.15;
--glass-heading-case: none;
--glass-heading-wrap: balance;
--glass-hyphens: manual;
--glass-display-weight: 700;
--glass-display-tracking: -0.03em;
--glass-numeric: tabular-nums;
--glass-font-features: normal;
--glass-measure: 68ch;
--glass-underline-offset: 0.22em;
}
.dark {
--aurora-1: oklch(0 0 none);
--aurora-2: oklch(0 0 none);
--aurora-3: oklch(0 0 none);
--success: oklch(0.74 0.15 150);
--success-foreground: oklch(0.2 0.04 150);
--warning: oklch(0.8 0.16 80);
--warning-foreground: oklch(0.2 0.04 80);
--info: oklch(0.74 0.126 205);
--info-foreground: oklch(0.2 0.036 205);
--aurora-base: oklch(0 0 none);
--glass-tint: oklch(0.227 0.004 286.1);
--glass-opacity: 45%;
--glass-opacity-strong: 72%;
--glass-opacity-subtle: 24%;
--glass-opacity-thick: 84%;
--glass-blur: 28px;
--glass-saturate: 180%;
--glass-brightness: 100%;
--glass-sheen: 0%;
--glass-sheen-angle: 160deg;
--glass-texture: none;
--glass-fill-tint: oklch(0.575 0.012 286);
--glass-fill-opacity: 24%;
--glass-fill-opacity-strong: 36%;
--glass-thumb: oklch(1 0 0 / 20%);
--glass-label: oklch(1 0 none);
--glass-clarity: 0.5;
--glass-label-secondary: oklch(0.88 0.01 285);
--glass-label-tertiary: oklch(0.66 0.01 285);
--glass-ink-strength: 60%;
--glass-label-quaternary: oklch(0.45 0.01 285);
--glass-separator-opacity: 16%;
--glass-knob: oklch(1 0 0);
--glass-liquid-opacity: 48%;
--glass-liquid-clear-opacity: 8%;
--glass-liquid-clear-dim: 35%;
--glass-liquid-blur: 18px;
--glass-liquid-clear-blur: 4px;
--glass-liquid-saturate: 160%;
--glass-refraction: 14px;
--glass-bezel: 12px;
--glass-depth-opacity: 12%;
--glass-depth-blur: 6px;
--glass-inactive-strength: 0.4;
--glass-border-color: oklch(1 0 0);
--glass-border-opacity: 12%;
--glass-border-width: 1px;
--glass-highlight-opacity: 14%;
--glass-highlight-color: oklch(1 0 0);
--glass-light-angle: -45deg;
--glass-specular: 65%;
--glass-edge-shade: 32%;
--glass-illumination: 22%;
--glass-shadow-color: oklch(0 0 0);
--glass-shadow-opacity: 45%;
--glass-shadow-y: 10px;
--glass-shadow-blur: 30px;
--glass-dim: 45%;
--glass-shadow-over-content: 1.6;
--glass-glow: 0%;
--glass-radius-surface: 1.5rem;
--glass-radius-control: 0.75rem;
--glass-radius-button: 9999px;
--glass-radius-badge: 9999px;
--glass-hit-min: 44px;
--glass-density: 1;
--glass-duration: 200ms;
--glass-ease: linear(0, 0.028, 0.098, 0.194, 0.302, 0.415, 0.523, 0.624, 0.713, 0.79, 0.855, 0.908, 0.949, 0.98, 1.003, 1.019, 1.029, 1.034, 1.036, 1.036, 1.034, 1.03, 1.026, 1.022, 1.018, 1.015, 1.011, 1.008, 1.006, 1.004, 1.002, 1.001, 1, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 1);
--glass-press-scale: 0.97;
--glass-press-stretch: 0.04;
--glass-press-grow: 1.04;
--glass-knob-lens-scale: 1.15;
--aurora-opacity: 100%;
--aurora-scale: 1;
--aurora-speed: 1;
--aurora-blur: 0px;
--glass-ring-width: 3px;
--glass-text-scale: 1;
--glass-type-ratio: 1.25;
--glass-leading: 1.6;
--glass-tracking: 0em;
--glass-body-weight: 400;
--glass-heading-weight: 650;
--glass-heading-tracking: -0.015em;
--glass-heading-leading: 1.15;
--glass-heading-case: none;
--glass-heading-wrap: balance;
--glass-hyphens: manual;
--glass-display-weight: 700;
--glass-display-tracking: -0.03em;
--glass-numeric: tabular-nums;
--glass-font-features: normal;
--glass-measure: 68ch;
--glass-underline-offset: 0.22em;
}