004 Continuous Corners
段階的な角丸と連続曲率の角丸
入れ子の角丸を階層ごとにどう計算するか、そしていつ連続曲率の角丸に切り替えるか。カードやフォームの角をきれいにそろえます。
角丸 16px、パディング 8px のカードで、中のボタンにも 16px の角丸を使うと、角の部分で2本の枠線の間隔が直線部分より広くなり、ボタンがカードに沿っていないように見えます。大きな角丸が直線につながる部分には、折れ目も見えます。方法は次の4つです:
- 均等なインセット:フォーム、入れ子のカード、ダイアログなど、内側と外側の2層の角丸があるところに使います。各層を「内側の角丸 = 外側の角丸 − 間隔」で計算し、内外で中心を共有すると、角の間隔が直線部分と同じになります。カードの角丸が 16、パディングが 8 なら、中のボタンの角丸は 8 です。
- 多層の入れ子:3層以上のときは、外側から内側へ1層ずつ計算します。ダイアログの角丸が 32、パディングが 16 なら、内側のパネルとボタンは 16 です。パネルの中でさらに 8 内側にタグを置くなら、タグは 8 です。同じ階層の要素は同じ角丸を使い、最小でも 4 にします。
- ピル形と円形:コンテナの中に入れ子になったピル形や円形の要素は計算に含めず、常に完全な丸のままにします。
- 連続曲率の角丸:角丸が大きく接続部に折れ目が見える場合や、iOS に近い角丸の見た目にしたい場合に使います。通常の角丸は直線につながる部分で曲率が急に変わりますが、連続曲率の角丸(スーパー楕円)は曲率が徐々に大きくなるため、より滑らかにつながります。書き方は
border-radius: 32px; corner-shape: superellipse(1.25);です。
なお、corner-shape に対応しているのは現在 Chrome と Edge のバージョン 139 以降だけです。Safari と Firefox では自動的に通常の角丸になるので、特別な対応は必要ありません。
付属の Prompt は、指定した画面の角丸を外側から内側へ計算し直します。プロジェクトに角丸のトークンがある場合は、トークンを直接変更します。
Make the corner radii in this UI consistent, then switch them to continuous
corners. Work on the screen or components I name; ask me if I have not
named them. If the project has radius tokens, change those instead of
hard-coding values.
1. Inner radius = outer radius - padding (r = R - p)
- Go from the outside in: dialog or card -> panels, inputs, buttons ->
chips and tags. A box p inside a container with radius R gets R - p,
so both corners share one center. Example: dialog 32, padding 16 ->
panels and buttons 16; a chip 8 inside a 16 panel -> 8.
- Boxes on the same level share one radius. Never go below 4.
- Pills and circles stay fully round.
- Keep every padding, gap and radius on a 4px grid.
2. Continuous corners
- Keep border-radius and add the curve as progressive enhancement:
@supports (corner-shape: superellipse(1.25)) {
:where(*) { corner-shape: superellipse(1.25); }
}
Set corner-shape: round on pills and circles.
- Chrome and Edge 139+ render it; Safari and Firefox skip the block and
show the plain border-radius.
When done, list every radius you changed as "element: old -> new".




















