sdxc

[ @sdxc/u/size ]

padding-inline-start

Applies padding-inline-start — the leading inline edge, which is the left edge in ltr and the right edge in rtl.

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

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.pis(4)css({ paddingInlineStart: "calc(var(--ui-spacing, 0.25rem) * 4)" })

Examples

Basic example

Use pis(n) to pad the inline-start edge of an element, its left in left-to-right text:

pis(12)
<div mix={[pis(12), ...]}>
	<div mix={[...]}>pis(12)</div>
</div>

Writing direction

pis() follows the writing direction: on the left in left-to-right text and on the right in right-to-left text:

ltr
rtl
<div mix={[...]}>
	<div dir="ltr" mix={[pis(12), ...]}>
		<div mix={[...]}>ltr</div>
	</div>
	<div dir="rtl" mix={[pis(12), ...]}>
		<div mix={[...]}>rtl</div>
	</div>
</div>

Using a custom value

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

u.pis("2.75rem")

Applying on a state

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

u.hover(u.pis(4))

Responsive design

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

u.at("md", u.pis(4))

Customizing your theme

Customizing spacing

Every numeric step multiplies --ui-spacing, so redefining it rescales every spacing and sizing utility at once:

:root {
	--ui-spacing: 0.25rem;
}

Every call that names the step now reads the new value:

pis(4)

Signature

u.pis(value: SpacingValue)

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.