sdxc

Type to search, or start from one of these:

size

object-position

Applies object-position, choosing which part of a replaced element's cropped content stays visible, keeping a subject's face in frame once u.fit("cover") crops it.

import { objectPosition } from "@sdxc/u/size";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.objectPosition()css({ objectPosition: "center" })
u.objectPosition("top")css({ objectPosition: "top" })
u.objectPosition("50% 20%")css({ objectPosition: "50% 20%" })

Using a custom value

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

u.objectPosition()

Applying on a state

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

u.hover(u.objectPosition())

Responsive design

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

u.at("md", u.objectPosition())

Signature

u.objectPosition(value?: ObjectPositionValue)