# max-inline-size

> Applies `max-inline-size`.

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

Applies `max-inline-size`.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.maxIs("60ch")` | `css({ maxInlineSize: "60ch" })` |
| `u.maxIs("full")` | `css({ maxInlineSize: "100%" })` |

## Examples

### Basic example

Use `maxIs(n)` to cap an element's inline size, like `maxIs(64)` or `maxIs(96)`:

```tsx
<div mix={[...]}>
	<div mix={[maxIs(128), ...]}>maxIs(128)</div>
	<div mix={[maxIs(96), ...]}>maxIs(96)</div>
	<div mix={[maxIs(64), ...]}>maxIs(64)</div>
	<div mix={[maxIs(48), ...]}>maxIs(48)</div>
</div>
```

### Readable line length

Pass any CSS length as a string, like `maxIs("45ch")`, to keep lines of text at a comfortable length:

```tsx
<p mix={[maxIs("45ch"), ...]}>
	Margins, padding and sizes in this package follow the writing mode, so a layout written once
	reads correctly in every language. A card padded on its inline start keeps that padding where
	a sentence begins, whichever side of the screen that is, and the same holds for a list, a
	sidebar or a toolbar.
</p>
```

## Applying on a state

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

```ts
u.hover(u.maxIs("60ch"))
```

## Responsive design

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

```ts
u.at("md", u.maxIs("60ch"))
```

## 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
maxIs(4)
```

## Signature

```ts
u.maxIs(value: SizeValue)
```
