effects
dropShadow
Applies filter: drop-shadow(...), shadowing the element's rendered shape — a PNG's alpha channel, an SVG icon's outline — with offsets and a blur radius.
import { dropShadow } from "@sdxc/u/effects";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.dropShadow() | css({ "--ui-filter-drop-shadow": "calc(var(--ui-spacing, 0.25rem) * 0) calc(var(--ui-spacing, 0.25rem) * 1) calc(var(--ui-spacing, 0.25rem) * 2) rgb(0 0 0 / 0.15)", filter: "... drop-shadow(var(--ui-filter-drop-shadow, 0 0 0 transparent))" }) |
u.dropShadow({ y: "2px", blur: "4px", color: "brand" }) | css({ "--ui-filter-drop-shadow": "calc(var(--ui-spacing, 0.25rem) * 0) 2px 4px var(--ui-brand-border)", filter: "... drop-shadow(var(--ui-filter-drop-shadow, 0 0 0 transparent))" }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.dropShadow()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.dropShadow())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.dropShadow())Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-brand-border |
--ui-filter-drop-shadow |
--ui-spacing |
Signature
u.dropShadow(options?: DropShadowOptions)