# border-end-start-radius

> Applies a radius from the radius scale, or a raw CSS length, to one logical corner — for shapes that round three corners uniformly and differentiate the fourth, like a chat bubble's tail.

```ts
import { roundedCorner } from "@sdxc/u/effects";
```

Applies a radius from the radius scale, or a raw CSS length, to one logical
corner — for shapes that round three corners uniformly and differentiate
the fourth, like a chat bubble's tail.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.roundedCorner("end-start", "xs")` | `css({ borderEndStartRadius: "var(--ui-radius-xs, 0.125rem)" })` |

## Examples

### Basic example

Use `roundedCorner(corner, step)` to round one corner, named by its block and inline side, like `"start-start"` for the top left in English:

```tsx
<div mix={[...]}>
	<div mix={[roundedCorner("start-start", "xl"), ...]}>start-start</div>
	<div mix={[roundedCorner("start-end", "xl"), ...]}>start-end</div>
	<div mix={[roundedCorner("end-start", "xl"), ...]}>end-start</div>
	<div mix={[roundedCorner("end-end", "xl"), ...]}>end-end</div>
</div>
```

### Shaping a chat bubble

Round three corners and leave the fourth square to point a message bubble at its sender:

```tsx
<p
	mix={[
		roundedCorner("start-start", "xl"),
		roundedCorner("start-end", "xl"),
		roundedCorner("end-end", "xl"),
		...,
	]}
>
	See you at the station at six?
</p>
```

### Following the writing direction

Logical corners follow the writing direction, so `"start-start"` is the top right corner inside `dir="rtl"`:

```tsx
<div mix={[...]}>
	<div dir="ltr" mix={[roundedCorner("start-start", "xl"), ...]}>
		ltr
	</div>
	<div dir="rtl" mix={[roundedCorner("start-start", "xl"), ...]}>
		rtl
	</div>
</div>
```

## Applying on a state

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

```ts
u.hover(u.roundedCorner("end-start", "xs"))
```

## Responsive design

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

```ts
u.at("md", u.roundedCorner("end-start", "xs"))
```

## Customizing your theme

### Customizing radii

Redefine a `--ui-radius-*` variable to change a step, or declare a new one:

```css
:root {
	--ui-radius-2xl: 1rem;
}
```

```ts
declare module "@sdxc/u" {
	interface Radii {
		"2xl": true;
	}
}
```

The new name is then accepted wherever the scale is:

```ts
rounded("2xl")
```

## Signature

```ts
u.roundedCorner(corner: LogicalCorner, name?: RadiusName | (string & {}))
```
