A practical way to render a squircle in CSS is clip-path: path() with the generated superellipse outline. Unlike border-radius (which uses circular-arc corners), a path-based clip follows the selected mathematical curve. Browser support is broad, but check current compatibility for your audience.
Set the width, height and smoothing in the generator, then copy the ready-made clip-path: path("…") string.
border-radius rounds corners with a quarter-circle arc. A squircle is a superellipse — |x/a|n + |y/b|n = 1 — where curvature changes continuously into the corner. The generator samples that equation into an SVG-style path string, and clip-path: path() clips the element to the generated outline.
.squircle {
width: 240px;
height: 240px;
background: #5b8cff;
clip-path: path("M 240.00 120.00 L … Z"); /* from the generator */
}
The path coordinates are in pixels relative to the element's box, so the clip only matches if the element's size equals the size you generated. Change the dimensions → regenerate the path.
| Method | Support |
|---|---|
clip-path: path() | Broad support; fixed path coordinates do not scale automatically |
corner-shape: superellipse() | Experimental and limited availability |
For production, verify current path() compatibility. The newer superellipse() function remains experimental and is not available in every major browser.
border-radius into a superellipse; use once support is broad.clip-path clips the border too; for an outlined squircle, layer two clipped elements or use the SVG stroke approach.Yes, modern Safari supports clip-path: path(). It is broadly supported across current browsers.
A pixel path is fixed-size. For fluid scaling, use the SVG version, which scales with its viewBox.
Stack a slightly larger clipped element behind it as the "border", or use the SVG with a stroke. A normal CSS border gets clipped.