sdxc

Type to search, or start from one of these:

general

border-radius

Flattens input and merges the flattened utilities' style trees into one declaration set at the host's own level, so unrelated utilities compose as a single mixin with each nested selector kept as a sibling.

import { combine } from "@sdxc/u/general";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.combine([u.rounded("lg"), u.border({ color: "neutral", width: 1 })])css({ borderRadius: "var(--ui-radius-lg, 0.5rem)", borderColor: "var(--ui-neutral-border)", borderWidth: "1px", borderStyle: "solid" })
u.combine([u.when("&:hover", u.bg("brand.tint")), u.when("&:focus", u.bg("brand.tint"))])css({ "&:hover": { backgroundColor: "..." }, "&:focus": { backgroundColor: "..." } })

Using a custom value

Every scale argument also takes a raw CSS value, which passes through untouched.

u.combine([u.rounded("lg"), u.border({ color: "neutral", width: 1 })])

Applying on a state

Wrap the call in a state utility to scope it to one selector.

u.hover(u.combine([u.rounded("lg"), u.border({ color: "neutral", width: 1 })]))

Responsive design

Wrap the call in a container query to scope it to one width.

u.at("md", u.combine([u.rounded("lg"), u.border({ color: "neutral", width: 1 })]))

Customizing the theme

The custom properties this utility reads, which a theme redefines.

Variable
--ui-neutral-border
--ui-radius-lg

Signature

u.combine(input: UtilityInput<Node>)