# margin-inline

> Applies `margin-inline`.

```ts
import { mi } from "@sdxc/u/size";
```

Applies `margin-inline`. One value applies both inline edges; two values
map to inline-start then inline-end.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.mi(4, "auto")` | `css({ marginInline: "calc(var(--ui-spacing, 0.25rem) * 4) auto" })` |

## Examples

### Basic example

Use `mi(n)` to add margin to the inline-start and inline-end edges of an element, left and right of it in horizontal text:

```tsx
<div mix={[...]}>
	<div mix={[mi(8), ...]}>mi(8)</div>
</div>
```

### Start and end

Pass two values to set the inline-start and then the inline-end margin, like `mi(2, 12)`:

```tsx
<div mix={[...]}>
	<div mix={[mi(2, 12), ...]}>mi(2, 12)</div>
</div>
```

### Centering with auto

Use `mi("auto")` to center an element that has a width inside its container:

```tsx
<div mix={[...]}>
	<div mix={[mi("auto"), is(64), ...]}>mi("auto")</div>
</div>
```

## Applying on a state

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

```ts
u.hover(u.mi(4, "auto"))
```

## Responsive design

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

```ts
u.at("md", u.mi(4, "auto"))
```

## Customizing your theme

### Customizing spacing

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

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

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

```ts
mi(4)
```

## Signature

```ts
u.mi(...values: SpacingValue[])
```
