{"id":6042,"date":"2025-06-04T06:23:09","date_gmt":"2025-06-04T11:23:09","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=6042"},"modified":"2025-06-04T06:23:10","modified_gmt":"2025-06-04T11:23:10","slug":"svg-to-shape","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/svg-to-shape\/","title":{"rendered":"SVG to shape()"},"content":{"rendered":"\n<p>We&#8217;ve been trying to make the point around here that the new <a href=\"https:\/\/frontendmasters.com\/blog\/tag\/shape\/\"><code>shape()<\/code> in CSS<\/a> is awesome. It&#8217;s the powerful <code>&lt;path><\/code> in SVG ported to CSS so it can use actual units. It&#8217;s probably how <code>path()<\/code> should have ported to begin with, but c\u2019est la vie.<\/p>\n\n\n\n<p><a href=\"https:\/\/codepen.io\/chriscoyier\/pen\/JodbMoy?editors=1100\">I&#8217;ll make the point in this demo.<\/a> Resize those containers and see how the <code>clip-path<\/code> responds (<code>path()<\/code> cannot be fluid, <code>shape()<\/code> can).<\/p>\n\n\n\n<p>Are SVG <code>&lt;path><\/code>s 1-to-1 convertible to <code>shape()<\/code>, though? Apparently they are! (!!). Two people have already built converters and from what I&#8217;ve tested they work great.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/css-generators.com\/svg-to-css\/\">https:\/\/css-generators.com\/svg-to-css\/<\/a> Temani Afif<\/li>\n\n\n\n<li><a href=\"https:\/\/path-to-shape.netlify.app\/\">https:\/\/path-to-shape.netlify.app\/<\/a> Matthew Morete<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve been trying to make the point around here that the new shape() in CSS is awesome. It&#8217;s the powerful &lt;path> in SVG ported to CSS so it can use actual units. It&#8217;s probably how path() should have ported to begin with, but c\u2019est la vie. I&#8217;ll make the point in this demo. Resize those [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6050,"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":[216,7,352,91],"class_list":["post-6042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-clip-path","tag-css","tag-shape","tag-svg"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/06\/shape-output-thumb.jpg?fit=2400%2C1556&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6042","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=6042"}],"version-history":[{"count":5,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6042\/revisions"}],"predecessor-version":[{"id":6049,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/6042\/revisions\/6049"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/6050"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=6042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=6042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=6042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}