tailwindcss
tailwindcss copied to clipboard
Add `corner-shape` utility classes (`corner-*`)
This PR adds utilities to control the shape of rounded corners of an element. These map to the new corner-shape property in CSS.
You can use the corner-* utilities to control the shape of all corners simultaneously or use utilities like corner-t-*, corner-bl-*, etc… to control individual corners.
| Utility | Affected corners |
|---|---|
corner-* |
all |
corner-t-* |
top left, top right |
corner-b-* |
bottom left, bottom right |
corner-l-* |
top left, bottom left |
corner-r-* |
top right, bottom right |
corner-tl-* |
top left |
corner-tr-* |
top right |
corner-bl-* |
bottom left |
corner-br-* |
bottom right |
corner-s-* |
(logical) start start, end start |
corner-e-* |
(logical) start end, end end |
corner-ss-* |
(logical) start start |
corner-se-* |
(logical) start end |
corner-ee-* |
(logical) end end |
corner-es-* |
(logical) end start |
Each utility has a handful of pre-defined values that map to their counterparts in CSS. Shown here are the versions for shaping all corners but they're present individual corner utilities as well:
| Utility | Value |
|---|---|
corner-round |
corner-shape: round |
corner-scoop |
corner-shape: scoop |
corner-bevel |
corner-shape: bevel |
corner-notch |
corner-shape: notch |
corner-square |
corner-shape: square |
corner-squircle |
corner-shape: squircle |
Additionally, arbitrary values are supported so you can use custom superellipse(…) values e.g. corner-[superellipse(1.333)].
For an idea of what each of these do you can use Chrome to look at this Play (or any other supported browser). Otherwise there's a screenshot below: