a11y
position
Clips the host to a 1px box taken out of layout flow, keeping its native focusability and tab order intact so screen readers and keyboard users still reach it.
import { visuallyHidden } from "@sdxc/u/a11y";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.visuallyHidden() | css({
position: "absolute",
inlineSize: "1px",
blockSize: "1px",
padding: "0",
margin: "-1px",
overflow: "hidden",
clip: "rect(0, 0, 0, 0)",
whiteSpace: "nowrap",
borderWidth: "0",
}) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.visuallyHidden()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.visuallyHidden())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.visuallyHidden())Signature
u.visuallyHidden()