Effects & Media /
newGlass
Frosted-glass surface utilities (backdrop-filter) for overlays, hero cards, and floating panels. CSS-only — compose onto any element.
Overview
Glass is a CSS utility, not a component — add the class to any element. It pairs backdrop-filter blur with a tinted fill and a hairline border that flips correctly in dark mode.
Examples
Variants
Full frost, subtle (near-transparent), and raised (with elevation).
Glass
Full frost
Subtle
Mostly blur
Raised
+ shadow
⚠️ Frost vs. animation
Never animate or transform a glass element — or any ancestor of one.
A transform, opacity<1, filter, will-change, or an entrance animation on an ancestor promotes it to a “backdrop root”, and the frost silently renders nothing (even though it still shows in devtools). Animate a glass-free sibling, or the content inside the glass. Wrap the glass + its decorative background in .naraya-glass-root to establish the backdrop root on purpose.
Classes
Tokens Used
--bg-glass / --bg-glass-alphaTinted fill + opacity
--bg-glass-subtle-alphaSubtle variant opacity
--glass-blur / --glass-subtle-blurBlur radius
--glass-saturateBackdrop saturation boost
--glass-border / --glass-border-alphaHairline border (theme-aware)
--shadow-lgRaised elevation