sdxc

Type to search, or start from one of these:

state

selection

Applies utilities to the element's ::selection; only color, background-color, text-decoration, and text-shadow take effect, and overriding the platform's contrast guarantee requires a high-contrast pair.

import { selection } from "@sdxc/u/state";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.selection(u.bg("brand.tint"))css({ "&::selection": { backgroundColor: "..." } })

Using a custom value

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

u.selection(u.bg("brand.tint"))

Responsive design

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

u.at("md", u.selection(u.bg("brand.tint")))

Signature

u.selection(input: UtilityInput<Node>)