state
aria
Sugar over when(...) for an element's aria-* attribute selector: two args match the attribute present with any value — including "false" — while three args match a value exactly; pass "true" for the truthy case.
import { aria } from "@sdxc/u/state";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.aria("selected", "true", u.bg("brand.tint")) | css({ '&[aria-selected="true"]': { backgroundColor: "..." } }) |
u.aria("busy", u.opacity(50)) | css({ "&[aria-busy]": { opacity: 0.5 } }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.aria("selected", "true", u.bg("brand.tint"))Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.aria("selected", "true", u.bg("brand.tint")))Signature
u.aria(attribute: string, input: UtilityInput<Node>)