# flexColReverse

> Sets `display: flex; flex-direction: column-reverse`.

```ts
import { flexColReverse } from "@sdxc/u/layout";
```

Sets `display: flex; flex-direction: column-reverse`.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.flexColReverse()` | `css({ display: "flex", flexDirection: "column-reverse" })` |

## Examples

### Basic example

Use `flexColReverse()` to stack flex items vertically in the opposite order; it makes the element a flex container too:

```tsx
<div mix={[flexColReverse(), gap(4), is(64)]}>
	<div mix={[...]}>01</div>
	<div mix={[...]}>02</div>
	<div mix={[...]}>03</div>
</div>
```

### Opening a chat at the newest message

A scroll container with `flexColReverse()` starts scrolled to its end, so write the newest message first and the log opens on it. Scroll up for older messages:

```tsx
<div mix={[flexColReverse(), gap(2), overflowY("auto"), is(72), bs(48), ...]}>
	<div mix={[...]}>Message 8 (newest)</div>
	<div mix={[...]}>Message 7</div>
	<div mix={[...]}>Message 6</div>
	<div mix={[...]}>Message 5</div>
	<div mix={[...]}>Message 4</div>
	<div mix={[...]}>Message 3</div>
	<div mix={[...]}>Message 2</div>
	<div mix={[...]}>Message 1 (oldest)</div>
</div>
```

## Applying on a state

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

```ts
u.hover(u.flexColReverse())
```

## Responsive design

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

```ts
u.at("md", u.flexColReverse())
```

## Signature

```ts
u.flexColReverse()
```
