Continuous Corners in CSS
Abstract
Rounded rectangles drawn with border-radius join a straight edge to a circular arc. The join is smooth in direction but not in curvature: curvature jumps from to at the tangent point, and on large, outlined, glassy surfaces the eye reads that jump as a faint kink. This note documents how this blog replaced those arcs with curvature-continuous superellipses using the CSS corner-shape property. We (1) derive a radius correction that keeps the perceived size of every corner unchanged, (2) show that the familiar concentric rule (inner radius = outer radius − gap) has to be scaled for superellipses, (3) test the alternatives, SVG clip-path/mask and Houdini paint worklets, against the site’s backdrop-filter glass and find them unworkable, and (4) report a site-wide audit, the regression it caught, and the remaining limitations. The shipped system is three design tokens and a handful of utility classes; browsers without corner-shape fall back to the original design pixel for pixel.
1. Introduction
A corner made of a straight line and a quarter circle is G1-continuous: position and tangent agree where the two meet. It is not G2-continuous: curvature, the inverse of the local radius, steps from zero on the edge to on the arc. Apple’s hardware and interfaces popularised “continuous” corners whose curvature ramps up gradually instead, and design tools such as Figma expose the idea as corner smoothing [5].
On this blog the step was most visible on large cards that carry a 1 px inner stroke and a glass edge highlight, because both trace the silhouette precisely. The goal was to remove the step wherever it is visible, without changing the overall look, without breaking the glass effects, and without degrading browsers that cannot draw the new shape.
2. Background
2.1 Superellipses in CSS
CSS Borders Level 4 adds the corner-shape property [1]. Its general form is superellipse(k), where each corner follows
scaled to the box’s border radius. is the familiar circle (round), is the keyword squircle, gives a square corner and a bevel. Chromium draws each half corner with one cubic Bézier [2], and the shape applies consistently to the background, borders, outline, box-shadow, overflow clipping and backdrop-filter.
2.2 Why superellipses remove the step
Near the point where a superellipse of radius meets the straight edge, its distance from the edge behaves like , so its curvature is
For this tends to zero at the join: curvature starts from the edge’s value of zero instead of jumping to . With () we get , so even the rate of change of curvature starts at zero. Figure 1 shows the profiles: the circle is a box function, the superellipse a bell.

Figure 1. Left: the same 24 px corner drawn four ways, magnified 9×. Right: curvature along the outline, normalised so that the circle equals 1.
3. Method
3.1 Keeping every corner the same size
Swapping the shape while keeping the radius is the wrong replacement. A superellipse hugs the corner more tightly than a circle of the same radius: its curvature peaks at about (dashed orange in Figure 1), so the corner looks sharper, the opposite of the intent. The radius has to grow.
As a simple proxy for perceived corner size we keep the corner’s depth along the 45° diagonal. For a superellipse corner that depth is , so matching a circle of radius requires the scale factor
Table 1 lists the candidates, measured on the cards’ 23.8 px radius at a 1440 px viewport.
| Shape | Scale | Max. | Peak | Figma |
|---|---|---|---|---|
| circle, | 1.00 | — | 1.00 | 0 % |
| 1.19 | 0.28 px | 1.15 | ≈ 60 % | |
| 1.43 | 0.48 px | 1.26 | — | |
| 1.84 | 0.68 px | 1.37 | ≈ 100 % |
Table 1. Corner candidates with equal diagonal depth. Max. is the largest distance between the new outline and the old arc. “Figma” is the closest corner-smoothing setting: 60 % (the “iOS” preset) matches within 0.15 px, 100 % within 0.11 px.
The striking result is how small the differences are: even the strongest option moves the outline by less than 0.7 px. In a side-by-side mockup the iOS-like setting () was too subtle to remove the perceived kink, while was visible yet calm. It shipped.
3.2 Concentric corners
The blog follows a concentric rule: media inset in a card by a gap use the inner radius , so the gap around the corner equals the gap along the edges. For circles this is exact, because the inward offset of a circle is again a circle. The inward offset of a superellipse is not a superellipse, and the naive rule leaves the corner gap too thick: by 0.7 px for and by 1.9 px for , at px. Fitting the inner radius numerically against the exact offset curve gives
with for , for and for , which brings the error below 0.25 px.
4. Alternatives and constraints
The site leans heavily on backdrop-filter: cards, floating panels and a progressively blurred navigation bar. In Chromium an element’s backdrop-filter only samples content up to its nearest backdrop root, and any ancestor with filter, opacity below 1, mask, clip-path or its own backdrop-filter becomes one [4]. A test page in Chrome 157 (Figure 2) checked each approach against that rule.

Figure 2. Twelve probes over a striped backdrop. Cells 4–6 show why clip-path and mask fail on glass; cell 9 shows that clip-path: inset(round) ignores corner-shape.
| Approach | Browsers | Shadows | Glass | Upkeep |
|---|---|---|---|---|
corner-shape | Chromium | ✓ | ✓ | low |
SVG clip-path / mask | all | ✗ | ✗ | high |
| Paint worklet | Chromium | ✗ | ✗ | medium |
| Larger radius only | all | ✓ | ✓ | none |
Table 2. Approaches compared. “Glass” means the element’s own backdrop-filter and any blur inside it keep working.
corner-shapedraws the shape natively, so shadows, outlines and blur follow it (cells 2, 7, 10). Other engines simply keep the circle.- SVG paths as
clip-pathormask(for example figma-squircle [3]) clip away shadows and outlines (cell 4). The usual fix, afilter: drop-shadow()on a wrapper, makes the wrapper a backdrop root, and the card loses its own blur (cell 5). A mask on any ancestor removes every blur inside it (cell 6). The paths are in pixels and must be recomputed whenever an element resizes. - Houdini paint worklets (for example smooth-corners) paint the shape into a
mask-image, so they inherit the same problems, and they run only in Chromium. - A larger
border-radiuskeeps everything working but leaves the curvature step in place.
Two more findings shaped the implementation. Pseudo-elements that draw strokes or highlights with border-radius: inherit must inherit the shape as well, or they drift away from their host at the corner (cell 3). And clip-path: inset(... round r) is always circular (cell 9), which matters for the site’s shared-element transitions (§5).
For performance, scrolling 40 glass cards under 4× CPU throttling in headless Chrome held 60 fps for circles, both superellipses and a clip-path polygon alike. That is not a GPU-accurate benchmark, but it found no regression worth chasing.
NOTEAt the time of writing only Chromium-based browsers (Chrome and Edge 139 and later) ship
corner-shape[6]. Everything below is written so that Safari and Firefox keep the original circular corners at their original radii.
5. Implementation
Three tokens drive everything. They default to the circle and switch only where the browser can draw the new shape:
:root { --corner-k: 1; --corner-scale: 1; --concentric-factor: 1; --corner-shape: superellipse(var(--corner-k)); --radius-surface: calc(var(--radius-large) * var(--corner-scale));}
@supports (corner-shape: superellipse(2)) { :root { --corner-k: 2; --corner-scale: 1.84; --concentric-factor: 1.75; }}The radius scale and the shape must always travel together; otherwise an element ends up either “larger but still circular” or “superellipse but too sharp”. So no component writes corner-shape directly. Elements pick one of a few Tailwind utilities instead (abridged):
/* cards, panels, dialogs, page containers, article images */@utility rounded-surface { border-radius: var(--radius-surface); corner-shape: var(--corner-shape);}
/* media inset N spacing units from a card's corner */@utility rounded-concentric-* { border-radius: max( calc( var(--radius-surface) - var(--spacing) * --value(number) * var(--concentric-factor) ), var(--radius-concentric-min) ); corner-shape: var(--corner-shape);}
/* overlays and highlights that follow their parent */@utility rounded-inherit { border-radius: inherit; corner-shape: inherit;}A medium variant serves smaller blocks such as diary photos, and code blocks get their own token: the Expressive Code borderRadius setting simply references var(--radius-block). Resetting the three tokens to 1 restores the old design everywhere, which is how the “before” images in this note were produced.
Transitions. Two animations, a post cover flying between the list and the article and the music panel growing out of its button, clip a moving copy with clip-path: inset(... round r). Because that clip is always circular, feeding it the superellipse radius would make the corner jump at both ends. The animations instead ask for the circle with the same diagonal depth (abridged):
const depth = (k: number) => 1 - 2 ** (-1 / 2 ** k);
export function circularRadius(element: Element): number { const style = getComputedStyle(element); const radius = parseFloat(style.borderTopLeftRadius) || 0; // "superellipse(2)" → 2, "round" → 1, keywords included const k = shapeParameter( style.getPropertyValue("corner-top-left-shape") || "round", ); return k > 1 ? (radius * depth(k)) / depth(1) : radius;}With this, the cover lands with a 23.8 px clip on a 43.8 px superellipse: exactly the clip it used before the change.
What stays round. Buttons, tags, pills, circular avatars and list rows keep circular corners. Their scaled radius would exceed half their height, the browser would clamp it, and a clamped superellipse turns a capsule into something closer to an app icon. The same clamping caused the one regression found after release (§6).
6. Evaluation
Figure 3 compares individual corners before and after; Figure 4 shows the home page.

Figure 3. (a) A post card. (b) A cover inset 10.2 px inside the card: the corner gap stays even. (c) A code block. (d) The category bar, a 46 px tall surface holding pills: the clamped superellipse (left) was a regression; the concentric arc (right) fixed it.

Figure 4. The home page before (tokens reset to 1) and after.
Audit. A headless script walked all 21 pages at desktop and phone widths and classified every element and pseudo-element with a non-zero radius. About 100 element types, roughly 2,000 rendered instances, now use the superellipse. None of them carries an unscaled radius, and no pseudo-element disagrees with its host. Everything still circular is a capsule, a circle, a small control or a radius of a few pixels, plus two hover and indicator backgrounds that were left alone on purpose.
A regression. The home page’s category bar is only 46 px tall, so its 43.8 px surface radius was clamped to 23.1 px, and a clamped corner is squarer than the circular ends of the pills inside it. The gap at the corner grew to 14.6 px, against 10.2 px along the edges. The fix applies the concentric rule in the other direction: the bar’s radius becomes the pill radius plus the padding, with a circular shape, which makes the gap exactly 10.2 px all around (Figure 3d).
.category-bar { border-radius: calc(var(--radius-compact) + var(--spacing) * 3); corner-shape: round;}The general lesson: a short container that holds capsules should be concentric with them, not borrow the card shape.
Checks. Lint, unit tests and the site’s motion guard (11 transition scenarios, including card-to-article flights) passed after each step, and the production CSS keeps every corner-shape rule through minification.
7. Limitations
- Only Chromium draws the new corners today. Other engines render the original design, so the site looks slightly different across browsers.
- Matching the diagonal depth is a perceptual heuristic, not the result of a user study.
- The concentric factors were fitted for this site’s radii and gaps. They vary little with the ratio, but they are not exact for every ratio.
- Small, clamped shapes are excluded by hand. A clamp that understands
corner-shapewould make that automatic. - The performance test was headless and frame-capped; a GPU trace on real hardware would be more convincing.
8. Conclusion
Curvature-continuous corners can be retrofitted to an existing design system with very little code, provided three things hold: the radius is scaled so that corners keep their size, the concentric rule is scaled so that gaps stay even, and shape and size cannot be set apart from each other. corner-shape is the only approach that coexists with glass UI; geometric clipping looks equivalent on paper but breaks shadows and backdrop filters in practice. The change moves the outline by less than 0.7 px, which is roughly how subtle it should feel.
References
- W3C. CSS Borders and Box Decorations Module Level 4. drafts.csswg.org/css-borders-4
- Chrome for Developers. The corner cases of implementing CSS corner-shape in Blink. developer.chrome.com/blog/implementing-corner-shape
- phamfoo. figma-squircle. github.com/phamfoo/figma-squircle
- W3C. Filter Effects Module Level 2 (backdrop root). drafts.fxtf.org/filter-effects-2
- Figma. Desperately seeking squircles. figma.com/blog/desperately-seeking-squircles
- MDN Web Docs. corner-shape. developer.mozilla.org/en-US/docs/Web/CSS/corner-shape
If this article helped you, please share it with others!
Some information may be outdated