{"id":9739,"date":"2026-05-19T08:06:44","date_gmt":"2026-05-19T13:06:44","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=9739"},"modified":"2026-05-19T08:26:27","modified_gmt":"2026-05-19T13:26:27","slug":"border-shape","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/border-shape\/","title":{"rendered":"border-shape"},"content":{"rendered":"\n<p><a href=\"https:\/\/una.im\/border-shape\">Una Kravets<\/a>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Creating non-standard shapes on the web, like a speech bubble or a heart have typically required you to cut off your actual borders with&nbsp;<code>clip-path<\/code>.&nbsp;[&#8230;] This is where&nbsp;<code>border-shape<\/code>&nbsp;comes in. It\u2019s a powerful upcoming CSS primitive that defines a custom shape for an element\u2019s border.<\/p>\n<\/blockquote>\n\n\n\n<p>Welp, <code>clip-path()<\/code> had a good run. I&#8217;ll always be fond of tools like <a href=\"https:\/\/bennettfeely.com\/clippy\/\">Clippy<\/a>. But <code>border-shape()<\/code> serves a much more common use case: you want to re-shape an element but <em>not<\/em> lose the <code>border<\/code> or <code>box-shadow<\/code> and whatnot.<\/p>\n\n\n\n<p><a href=\"https:\/\/wesbos.com\/tip\/css-border-shape-api\">Wes Bos has a great short video<\/a> showing off a use case combining it with the also-mega-powerful <code>shape()<\/code> function. I was hoping that an element newly-formed via <code>border-shape<\/code> would automatically have text flow into the new shape, but alas, it does not. If you <em>extend<\/em> the shape, the text flow ignores it, if you <em>cut into<\/em> the shape, it just cuts off the text, as if the text were still set in the rectangle of the original element. If you&#8217;re clever, though, <a href=\"https:\/\/codepen.io\/editor\/Maseone\/pen\/019dffcd-8dcb-7116-9043-f881637b3733\">you can split the shape into left\/right halves<\/a> and use <code>shape-outside<\/code> to reflow text into the new shape. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Una Kravets: Creating non-standard shapes on the web, like a speech bubble or a heart have typically required you to cut off your actual borders with&nbsp;clip-path.&nbsp;[&#8230;] This is where&nbsp;border-shape&nbsp;comes in. It\u2019s a powerful upcoming CSS primitive that defines a custom shape for an element\u2019s border. Welp, clip-path() had a good run. I&#8217;ll always be fond [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9742,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[484,7,352,118],"class_list":["post-9739","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-border-shape","tag-css","tag-shape","tag-shapes"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-19-at-6.06.28-AM.png?fit=1236%2C818&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/9739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=9739"}],"version-history":[{"count":3,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/9739\/revisions"}],"predecessor-version":[{"id":9744,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/9739\/revisions\/9744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/9742"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=9739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=9739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=9739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}