# scaleY

> Scales the element along the vertical axis only.

```ts
import { scaleY } from "@sdxc/u/transform";
```

Scales the element along the vertical axis only. A bare number is a
unitless factor; a string passes through unchanged. Composable with
every other `transform/` utility.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.scaleY(1.5)` | `css({ "--ui-scale-y": "1.5", transform: "... scale(var(--ui-scale-x, 1), var(--ui-scale-y, 1)) ..." })` |

## Examples

### Basic example

Use `scaleY(n)` with a unitless factor to resize an element vertically while its width stays the same:

```tsx
<div mix={[...]}>
	<div mix={[...]}>
		<div mix={[scaleY(0.5), ...]}>scaleY(0.5)</div>
	</div>
	<div mix={[...]}>
		<div mix={[scaleY(1), ...]}>scaleY(1)</div>
	</div>
	<div mix={[...]}>
		<div mix={[scaleY(1.5), ...]}>scaleY(1.5)</div>
	</div>
</div>
```

### Mirroring vertically

Use `scaleY(-1)` to flip an element upside down:

```tsx
<div mix={[...]}>
	<div mix={[...]}>
		<div mix={[scaleY(1), ...]}>▾ menu</div>
	</div>
	<div mix={[...]}>
		<div mix={[scaleY(-1), ...]}>▾ menu</div>
	</div>
</div>
```

### Flipping on open

Combine it with a state like `open()` to flip an indicator while a disclosure is open. Click the summary to try it:

```tsx
<details mix={[open(when("& .chevron", scaleY(-1))), ...]}>
	<summary>
		Details{" "}
		<span class="chevron" mix={[inlineBlock(), transition("transform")]}>
			▾
		</span>
	</summary>
	<p>The chevron flips while this panel is open.</p>
</details>
```

## Using a custom value

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

```ts
u.scaleY("2.75rem")
```

## Applying on a state

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

```ts
u.hover(u.scaleY(1.5))
```

## Responsive design

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

```ts
u.at("md", u.scaleY(1.5))
```

## Signature

```ts
u.scaleY(value: ScaleValue)
```
