effects
backdropBrightness
Scales the backdrop's lightness — below 1 darkens, above 1 brightens — keeping overlaid text legible.
import { backdropBrightness } from "@sdxc/u/effects";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.backdropBrightness() | css({ "--ui-backdrop-brightness": "1.1", backdropFilter: "... brightness(var(--ui-backdrop-brightness, 1)) ...", WebkitBackdropFilter: "... brightness(var(--ui-backdrop-brightness, 1)) ..." }) |
u.transparencySafe(u.backdropBrightness(0.8)) | css({ "@media (prefers-reduced-transparency: no-preference)": { "--ui-backdrop-brightness": "0.8", backdropFilter: "...", WebkitBackdropFilter: "..." } }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.backdropBrightness()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.backdropBrightness())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.backdropBrightness())Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-backdrop-brightness |
Signature
u.backdropBrightness(value?: number | (string & {}))