state
open
Sugar over when("&[open], &:popover-open", input), matching both the <details>/<dialog> open attribute and the Popover API's :popover-open pseudo-class.
import { open } from "@sdxc/u/state";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.open(u.opacity(100)) | css({ "&[open], &:popover-open": { opacity: 1 } }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.open(u.opacity("2.75rem"))Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.open(u.opacity(100)))Signature
u.open(input: UtilityInput<Node>)