effects
filterOpacity
Applies a filter: opacity(...), fading the element inside the filter pipeline so one pass carries the fade along with any blur() or grayscale().
import { filterOpacity } from "@sdxc/u/effects";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.filterOpacity() | css({ "--ui-filter-opacity": "0.5", filter: "... opacity(var(--ui-filter-opacity, 1)) ..." }) |
u.filterOpacity("25%") | css({ "--ui-filter-opacity": "25%", filter: "... opacity(var(--ui-filter-opacity, 1)) ..." }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.filterOpacity()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.filterOpacity())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.filterOpacity())Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-filter-opacity |
Signature
u.filterOpacity(value?: number | (string & {}))