{
  "id": 23104564,
  "title": "Creating Beveled Corners with “corner-shape”",
  "url": "https://urgent.news/2026/12/02/creating-beveled-corners-with-corner-shape",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-12-02T10:35:55.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://www.joshwcomeau.com/css/bevel-corners/"
  },
  "original_language": null,
  "account": "On December 1st 2026, a new NPM package was released focused on button UI sound effects. The creator found diagonal beveled corners to be a fun effect, made possible by the new corner-shape property. However, using this property proved to be challenging, as it required somewhat unintuitive methods to achieve the desired results.\n\nIn this blog post, the author explains how to create beveled corners using corner-shape. They begin with a basic example, where setting corner-shape: bevel changes the border-radius property from producing a rounded quarter-circle to drawing a diagonal line.\n\nOne notable feature of corner-shape is that it alters the element's border box, allowing other properties like outline and box-shadow to respect the beveled corners. This is a significant advantage over traditional methods. The author also demonstrates how to use clip-path to cut shapes into boxes, but notes that these effects are applied after borders/outlines/shadows.\n\nTo create a three-sided top edge, the author uses the :before pseudo-element, applying border-radius to the top two corners and omitting the bottom border. The height of the pseudo-element is adjusted to create a trapezoid shape that fits perfectly on top. The same technique is applied to the bottom edge using the :after pseudo-element.\n\nThe author also discusses how to create matching side borders, addressing a potential issue where the outline wraps around the top/bottom edges and creates a gap between the corners. By switching to using outline with the outline-offset property, the author resolves this issue.\n\nWhile the technique isn't perfect, the author explains that using thin borders (1-2px) minimizes visible issues. They also share a trick for making platforms stand out by using an outer edge with different colors.\n\nLastly, the author mentions an interesting feature of border-radius – the ability to create angled bevels by using different horizontal and vertical radius values. They note that this property has been available for a long time, but corner-shape makes it more useful.",
  "summary": null,
  "summary_source": "publisher",
  "key_points": [
    "December 1st, 2026, new NPM package \"corner-shape\" released",
    "Beveled corners created using corner-shape property",
    "Three-sided top and bottom edges achieved with :before/:after pseudo-elements"
  ],
  "editors_take": "Using the new corner-shape property allows developers to create beveled edges that properly interact with outlines and shadows unlike previous methods used in web design.",
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}