effects
backdropBlur
Blurs the backdrop by a step from the blur scale, whatever the user's transparency preference; u.translucent() is the gated variant with a solid fallback.
import { backdropBlur } from "@sdxc/u/effects";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.backdropBlur("lg") | css({ "--ui-backdrop-blur": "var(--ui-blur-lg, 24px)", backdropFilter: "blur(var(--ui-backdrop-blur, 0px)) brightness(var(--ui-backdrop-brightness, 1)) ...", WebkitBackdropFilter: "blur(var(--ui-backdrop-blur, 0px)) brightness(var(--ui-backdrop-brightness, 1)) ..." }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.backdropBlur("lg")Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.backdropBlur("lg"))Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.backdropBlur("lg"))Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-backdrop-blur |
--ui-backdrop-brightness |
--ui-blur-lg |
Signature
u.backdropBlur(name?: BlurName | (string & {}))