Tailwind CSS v4 plugin with three corner utilities:
- Concentric — auto-calculated inner border-radius for nested elements
- Outer corners — inverse (concave) rounded corners via pseudo-elements
- Corner shape — CSS
corner-shapeproperty (squircle,superellipse, etc.)
bun add tailwind-super-corners/* globals.css */
@import "tailwind-super-corners";If you use tailwind-merge, the package exports a plugin that registers all sc-* class groups automatically:
import { withSuperCorners } from "tailwind-super-corners"
import { extendTailwindMerge } from "tailwind-merge"
const twMerge = extendTailwindMerge(withSuperCorners)This ensures sc-concentric classes conflict correctly with rounded-*, shape keywords override each other, etc.
Automatically computes inner_radius = outer_radius - gap for nested elements. Supports unlimited nesting depth via CSS container style queries with even/odd parity toggle.
- Parent uses standard Tailwind
rounded-*andp-*classes — the plugin shadows these to also set--sc-radiusand--sc-gap. - Child uses
sc-concentricto read the propagated values and apply the correct inner radius. - Each nesting level accumulates the subtraction automatically.
These shadow core Tailwind utilities. You don't need special classes — just use normal rounded-* and p-*:
| Class | Sets |
|---|---|
rounded-{token} |
border-radius + --sc-radius |
rounded-t-{token} |
top corners + --sc-radius |
rounded-r-{token} |
right corners + --sc-radius |
rounded-b-{token} |
bottom corners + --sc-radius |
rounded-l-{token} |
left corners + --sc-radius |
p-{token} |
padding + --sc-gap |
px-{token} |
padding-inline + --sc-gap |
py-{token} |
padding-block + --sc-gap |
pt-{token} |
padding-top + --sc-gap |
pb-{token} |
padding-bottom + --sc-gap |
ps-{token} |
padding-inline-start + --sc-gap |
pe-{token} |
padding-inline-end + --sc-gap |
| Class | Corners affected | Fallback |
|---|---|---|
sc-concentric |
all | inherit |
sc-concentric-{token} |
all | {token} value |
sc-t-concentric[-{token}] |
top-left, top-right | |
sc-r-concentric[-{token}] |
top-right, bottom-right | |
sc-b-concentric[-{token}] |
bottom-right, bottom-left | |
sc-l-concentric[-{token}] |
top-left, bottom-left | |
sc-tl-concentric[-{token}] |
top-left | |
sc-tr-concentric[-{token}] |
top-right | |
sc-bl-concentric[-{token}] |
bottom-left | |
sc-br-concentric[-{token}] |
bottom-right |
The {token} is any borderRadius theme value (e.g. lg, xl, 3xl). When omitted, falls back to inherit.
<!-- Parent: 3xl radius, 4 padding -->
<div class="rounded-3xl p-4 bg-gray-100">
<!-- Child: auto-calculated radius (3xl - 4 = concentric) -->
<div class="sc-concentric bg-white">
<!-- Grandchild: works at any depth -->
<div class="p-2">
<div class="sc-concentric bg-gray-50">...</div>
</div>
</div>
</div><!-- If no parent propagates, falls back to rounded-lg -->
<div class="sc-concentric-lg bg-white">...</div>Creates inverse (concave) rounded corners using ::before and ::after pseudo-elements. The element must be position: relative for correct placement.
Automatically upgrades to native corner-shape: superellipse() with negative values when supported.
| Class | Description |
|---|---|
sc-out |
Both bottom corners, default radius |
sc-out-{size} |
Both bottom corners, custom radius |
| Class | Corners | Pseudo-elements |
|---|---|---|
sc-out-t[-{size}] |
top-left + top-right | ::before + ::after |
sc-out-b[-{size}] |
bottom-left + bottom-right | ::before + ::after |
sc-out-l[-{size}] |
left-top + left-bottom | ::before + ::after |
sc-out-r[-{size}] |
right-top + right-bottom | ::before + ::after |
| Class | Corner | Pseudo-element |
|---|---|---|
sc-out-tl[-{size}] |
top-left | ::before |
sc-out-tr[-{size}] |
top-right | ::after |
sc-out-bl[-{size}] |
bottom-left | ::before |
sc-out-br[-{size}] |
bottom-right | ::after |
sc-out-lt[-{size}] |
left-top | ::before |
sc-out-lb[-{size}] |
left-bottom | ::after |
sc-out-rt[-{size}] |
right-top | ::before |
sc-out-rb[-{size}] |
right-bottom | ::after |
Note on naming:
sc-out-bl= bottom-left (horizontal edge),sc-out-lb= left-bottom (vertical edge). The first letter indicates the edge, the second indicates which end of that edge.
- Without suffix: uses
--sc-out-radius-base(default1rem) - With suffix: accepts any length (
sc-out-2xl,sc-out-[12px]) or--radius-*theme tokens
<!-- Tab-like element with outer corners at the bottom -->
<div class="relative bg-blue-500 sc-out">
Tab content
</div>
<!-- Custom size -->
<div class="relative bg-blue-500 sc-out-xl">
Tab content
</div>
<!-- Only bottom-left corner -->
<div class="relative bg-blue-500 sc-out-bl">
Tab content
</div>- The element needs
position: relative(addrelativeclass) - The element needs a background (
bg-*), as pseudo-elements inherit it - Pseudo-elements are positioned absolutely outside the element bounds — ensure the parent has
overflow: visible(default)
Sets the CSS corner-shape property on individual or grouped corners.
| Class prefix | CSS output | --corner-superellipse |
|---|---|---|
sc-round |
corner-shape: round |
1 |
sc-scoop |
corner-shape: scoop |
-1 |
sc-bevel |
corner-shape: bevel |
0 |
sc-notch |
corner-shape: notch |
-infinity |
sc-square |
corner-shape: square |
infinity |
sc-squircle |
corner-shape: squircle |
2 |
sc-smooth |
corner-shape: superellipse(1.6) |
1.6 |
Use sc-superellipse/{value} for arbitrary superellipse values:
<div class="rounded-xl sc-superellipse/2">...</div> <!-- squircle -->
<div class="rounded-xl sc-superellipse/1.6">...</div> <!-- smooth -->
<div class="rounded-xl sc-superellipse/4">...</div> <!-- more squared -->Accepts numbers, e, pi, infinity, and their negatives.
All shape classes support side/corner prefixes:
| Prefix | Corners affected |
|---|---|
sc- |
all corners |
sc-t- |
top-left + top-right |
sc-r- |
top-right + bottom-right |
sc-b- |
bottom-right + bottom-left |
sc-l- |
top-left + bottom-left |
sc-s- |
start-start + end-start (logical) |
sc-e- |
start-end + end-end (logical) |
sc-tl- |
top-left |
sc-tr- |
top-right |
sc-br- |
bottom-right |
sc-bl- |
bottom-left |
sc-ss- |
start-start (logical) |
sc-se- |
start-end (logical) |
sc-ee- |
end-end (logical) |
sc-es- |
end-start (logical) |
<!-- Squircle all corners -->
<div class="rounded-2xl sc-squircle">...</div>
<!-- Smooth top, bevel bottom -->
<div class="rounded-2xl sc-t-smooth sc-b-bevel">...</div>
<!-- Custom superellipse on one corner -->
<div class="rounded-2xl sc-tl-superellipse/3">...</div>
<!-- Notch only bottom-right -->
<div class="rounded-xl sc-br-notch">...</div>corner-shape is a new CSS property. Currently supported in Chrome 138+ behind a flag. The --corner-superellipse custom property is always set for use by other utilities (like sc-out's progressive enhancement).
All three features compose together:
<!-- Outer card with squircle shape + concentric inner card -->
<div class="rounded-3xl p-6 bg-gray-100 sc-squircle">
<div class="sc-concentric bg-white p-4">
<div class="sc-concentric bg-gray-50">
Unlimited nesting, auto-calculated radius
</div>
</div>
</div>
<!-- Tab bar with outer corners and smooth shape -->
<div class="relative bg-white rounded-t-xl sc-out-bl sc-out-br sc-smooth">
Active tab
</div>| Variable | Set by | Description |
|---|---|---|
--sc-radius |
rounded-* publishers |
Propagated border-radius value |
--sc-gap |
p-* publishers |
Propagated padding/gap value |
--sc-odd / --sc-even |
Parity system | Accumulated radius at each depth |
--_sc-parity |
Parity system | Current parity (odd / even) |
--_sc-active |
rounded-* publishers |
Marks element as concentric root |
--sc-out-radius-base |
Theme | Default outer corner radius (1rem) |
--sc-out-mask |
Theme | Radial gradient mask for outer corners |
--corner-superellipse |
sc-{shape} |
Superellipse exponent for progressive enhancement |
MIT