How corner-shape changes the border box

Setting corner-shape: bevel alters what border-radius does: instead of tracing a quarter-circle, it draws a straight diagonal line across the corner.

<style>
  .box {
    corner-shape: bevel;
    border: 2px solid tomato;
    /* Try changing me! */
    border-radius: 16px;
  }
</style>

<div class="box"></div>
.box {
  width: 150px;
  height: 150px;
  border: 4px solid;
  border-radius: 32px;
  corner-shape: bevel;
}

The property's real significance is that it reshapes the element's actual border box, so outline and box-shadow follow the beveled edges.

<style>
  .box {
    --shadow-color: hsl(0deg 0% 0% / 0.5);
    corner-shape: bevel;
    border: 6px solid red;
    outline: 6px solid white;
    border-radius: 32px;
    box-shadow:
      0px 2px 4px var(--shadow-color),
      0px 4px 8px var(--shadow-color),
      0px 8px 16px var(--shadow-color);
  }
</style>

<div class="box"></div>

By contrast, clip-path is painted after borders, outlines and shadows, so it cannot give outlines or shadows this treatment.

Coloring the edges

Giving a single side a different color produces an abrupt switch at the middle of the bevel.

<style>
  .box {
    /* A white border... */
    border: 2px solid white;
    /* ...except on top: */
    border-top-color: red;
    
    border-radius: 16px;
    corner-shape: bevel;
  }
</style>

<div class="box"></div>

Restricting the border to one side is more useful: the border width tapers from the full border-width to 0 along the diagonal.

<style>
  .box {
    corner-shape: bevel;
    /* NOTE: Only border-top, no other borders. */
    border-top: 6px solid red;
    border-radius: 32px;
  }
</style>

<div class="box"></div>

Lighter and darker colors on the top and bottom edges then suggest a raised platform. As of December 1st 2026, however, Chrome has a bug where adjacent borders with different colors overlap; it is fixed in Chrome Canary, but the fix only ships with Chrome 159 on December 8th 2026. Until then, the borders must live on separate elements, which ::before/::after pseudo-elements provide.

<style>
  .box {
    position: relative;
    background: hsl(45deg 90% 60%);
    border-radius: 32px;
    corner-shape: bevel;

    &::before, &::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      corner-shape: inherit;
      pointer-events: none;
    }
    &::before {
      border-top: 6px solid hsl(50deg 100% 75%);
    }
    &::after {
      border-bottom: 6px solid hsl(35deg 60% 46%);
    }
  }
</style>

<div class="box"></div>

An octagon with two-tone corners

For the buttons project, the tapering effect wasn't the goal. Each corner should instead inherit the color of either the top or the bottom edge across its full diagonal, giving an eight-sided shape:

  • The top three edges take the lighter color.
  • The bottom three edges take the darker color.
  • The two vertical edges between them take an intermediate color.

The trick for the top edge is to apply border-radius only to the top two corners, leave the bottom corners at zero radius, and omit the bottom border. Varying the pseudo-element's height shapes a trapezoid that fits the top exactly.

<style>
  .box {
    --r: 32px;
    position: relative;
    border-radius: var(--r);
    corner-shape: bevel;
    background: hsl(210deg 15% 15%);

    &::before, &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: var(--r);
      border-radius: inherit;
      corner-shape: inherit;
      pointer-events: none;
    }

    &::before {
      top: 0;
      border-radius: var(--r) var(--r) 0 0;
      border: 6px solid white;
      border-bottom: none;
    }
    &::after {
      bottom: 0;
      border-radius: 0 0 var(--r) var(--r);
      border: 6px solid gray;
      border-top: none;
    }
  }
</style>

<div class="box"></div>

When the pseudo-element's height equals the top-left/top-right radius, the result is a three-sided shape that serves as the top edge. The ::after pseudo-element mirrors this for the bottom, omitting the top border and rounding only the bottom corners.

Closing the sides with outline

Putting a plain border on the parent doesn't close the shape: the border wraps around the top and bottom edges and leaves a gap at each corner.

<style>
  .box {
    --r: 32px;
    position: relative;
    border-radius: var(--r);
    /*
      👇 Try adding a regular border:
    */
    border: 6px solid darkgray;
    corner-shape: bevel;
    background: hsl(210deg 15% 15%);

    &::before, &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: var(--r);
      border-radius: inherit;
      corner-shape: inherit;
      pointer-events: none;
    }

    &::before {
      top: 0;
      border-radius: var(--r) var(--r) 0 0;
      border: 6px solid white;
      border-bottom: none;
    }
    &::after {
      bottom: 0;
      border-radius: 0 0 var(--r) var(--r);
      border: 6px solid gray;
      border-top: none;
    }
  }
</style>

<div class="box"></div>

Switching from border to outline solves it. The companion outline-offset pushes the outline inward so it sits beneath the top and bottom edges.

<style>
  .box {
    --r: 32px;
    --border-width: 6px;
    position: relative;
    border-radius: var(--r);
    corner-shape: bevel;
    background: hsl(210deg 15% 15%);
    /*
      👇 Use outline instead:
    */
    outline:
      var(--border-width) solid darkgray;
    outline-offset:
      calc(var(--border-width) * -1);

    &::before, &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: var(--r);
      border-radius: inherit;
      corner-shape: inherit;
      pointer-events: none;
    }

    &::before {
      top: 0;
      border-radius: var(--r) var(--r) 0 0;
      border: var(--border-width) solid white;
      border-bottom: none;
    }
    &::after {
      bottom: 0;
      border-radius: 0 0 var(--r) var(--r);
      border: var(--border-width) solid gray;
      border-top: none;
    }
  }
</style>

<div class="box"></div>

The joint between the side and top/bottom edges is drawn horizontally rather than at an angle, but with the 1–2px borders used in practice this is not visible; the chunky borders shown here are only for demonstration.

Steps, holes and angled bevels

Pairs of platforms can be stacked to make a step read more clearly, and the outer box can be flipped so it is darker on top and lighter on the bottom, implying a recessed area or a hole.

<style>
  .outer.box {
    --r: 16px;
    --top-color: hsl(210deg 30% 22%);
    --side-color: hsl(210deg 25% 30%);
    --bottom-color: hsl(210deg 20% 45%);
    padding: 3px;
    background: black;
  }
  .inner.box {
    --r: 14px;
    --top-color: hsl(210deg 35% 75%);
    --side-color: hsl(210deg 20% 35%);
    --bottom-color: hsl(210deg 25% 30%);
    width: 160px;
    height: 100px;
    background: hsl(210deg 15% 10%);
  }

  .box {
    --r: 32px;
    --border-width: 1px;
    position: relative;
    border-radius: var(--r);
    corner-shape: bevel;
    outline: var(--border-width) solid
      var(--side-color);
    outline-offset: calc(
      var(--border-width) * -1
    );

    &::before, &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: var(--r);
      border-radius: inherit;
      corner-shape: inherit;
      pointer-events: none;
    }

    &::before {
      top: 0;
      border-radius: var(--r) var(--r) 0 0;
      border: var(--border-width) solid
        var(--top-color);
      border-bottom: none;
    }
    &::after {
      bottom: 0;
      border-radius: 0 0 var(--r) var(--r);
      border: var(--border-width) solid
        var(--bottom-color);
      border-top: none;
    }
  }
</style>

<div class="outer box">
  <div class="inner box"></div>
</div>

Tuning all the colors takes trial and error; the HSL format helps, since saturation and lightness percentages can be nudged until the result looks right.

Angled bevels come from specifying different horizontal and vertical radii.

.box {
  width: 150px;
  height: 150px;
  border: 4px solid;
  border-radius: 48px / 48px;
  corner-shape: bevel;
}

The / in that value is a delimiter separating two sets of values, not division. border-radius accepts eight values in total, two groups of four: the first four set the horizontal radius and the last four the vertical radius.

.box {
  /* Specifying all values at once: */
  border-radius: 1px 2px 3px 4px / 5px 6px 7px 8px;
}

When only horizontal values are given, they are copied to the vertical radii. The eight-value form has long allowed elliptical rather than circular corners, which rarely looked right before; with corner-shape it becomes genuinely useful. The property also offers other shapes beyond the scope of this piece — for instance, squircle yields better-looking rounded corners when given asymmetrical, elliptical values.

<style>
  .box {
    border: 2px solid tomato;
    border-radius: 16px / 32px;
  }
</style>

<div class="box"></div>
<style>
  .box {
    border: 2px solid tomato;
    border-radius: 32px / 64px;
    corner-shape: squircle;
  }
</style>

<div class="box"></div>