{"id":4650,"date":"2024-12-02T14:25:58","date_gmt":"2024-12-02T19:25:58","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=4650"},"modified":"2024-12-04T16:21:03","modified_gmt":"2024-12-04T21:21:03","slug":"the-logical-border-radius-equivalents","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/the-logical-border-radius-equivalents\/","title":{"rendered":"The Logical Border Radius Equivalents"},"content":{"rendered":"\n<p>I find this hard to remember and it&#8217;s come up for me a few times lately so I&#8217;m writing it down gosh darn it!<\/p>\n\n\n\n<p>The individual corner <code>border-radius<\/code> values, like <code>border-top-right-radius<\/code> (which is hard enough to remember on its own) have logical property versions, meaning that should the flow of the document change, the border radius values should come along for the ride. <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>border-top-right-radius<\/td><td>border-start-end-radius<\/td><\/tr><tr><td>border-top-left-radius<\/td><td>border-start-start-radius<\/td><\/tr><tr><td>border-bottom-right-radius<\/td><td>border-end-end-radius<\/td><\/tr><tr><td>border-bottom-left-radius<\/td><td>border-end-start-radius<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>(By &#8220;equivalent&#8221; I mean the these turn out the same in left-to-right, top-to-bottom languages like English, Spanish, French, etc. In other directional situations, these are not equivalent, which is kinda the point.)<\/p>\n\n\n\n<p>The syntax is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">border-[block direction]-[inline direction]-radius<\/pre>\n\n\n\n<p>You&#8217;d choose the logical versions if you were using border-radius on elements where the flow was relevant. Here&#8217;s an example of a <a href=\"https:\/\/codepen.io\/chriscoyier\/pen\/azozXNW\/c42db23b0d5f93105fe3769d69065606\">&#8220;tag&#8221; shape<\/a> on some inline text, and you&#8217;d potentially <em>want<\/em> the direction to flip. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"552\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/12\/Screenshot-2024-11-29-at-3.59.05%E2%80%AFPM.png?resize=886%2C552&#038;ssl=1\" alt=\"\" class=\"wp-image-4656\" style=\"width:363px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/12\/Screenshot-2024-11-29-at-3.59.05%E2%80%AFPM.png?w=886&amp;ssl=1 886w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/12\/Screenshot-2024-11-29-at-3.59.05%E2%80%AFPM.png?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/12\/Screenshot-2024-11-29-at-3.59.05%E2%80%AFPM.png?resize=768%2C478&amp;ssl=1 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/figure>\n<\/div>\n\n\n<p>If border-radius is being applied entirely as an aesthetic thing and it makes more sense to apply physical directionality rather than text-flow directionality, which is entirely common, feel free to use the classic properties. <\/p>\n\n\n\n<p>I feel these newer logical properties for border-radius took an understandability hit, as while &#8220;border-top-right-radius&#8221; is hard to remember because of trying to remember the right order of the words, at least once you&#8217;ve got it, it&#8217;s clear where that radius is going to apply. Whereas with &#8220;border-start-end-radius&#8221; you just have to know (or guess and test) which direction &#8220;start&#8221; applies to and which direction &#8220;end&#8221; applies to.<\/p>\n\n\n\n<p>Something like <code>border-inline-start-block-end-radius<\/code> would solve that, but I do understand that is an awfully long property name and might suffer from confusion. If someone accidentally mentally grouped it like &#8220;border-inline&#8221; &#8220;start-block&#8221; &#8220;end-radius&#8221;, that&#8217;s, uh, a meaningless jumble. <\/p>\n\n\n\n<p>There is an interesting gotcha Michelle Barker found in <a href=\"https:\/\/css-irl.info\/logical-border-radius\/\">Logical Border Radius<\/a> with vertical writing modes, so if that comes up for you read what she&#8217;s got to say there. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I find this hard to remember and it&#8217;s come up for me a few times lately so I&#8217;m writing it down gosh darn it! The individual corner border-radius values, like border-top-right-radius (which is hard enough to remember on its own) have logical property versions, meaning that should the flow of the document change, the border [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4657,"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":[1],"tags":[],"class_list":["post-4650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-post"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/12\/pexels-photo-22702715.jpeg?fit=1880%2C1253&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/4650","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=4650"}],"version-history":[{"count":9,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/4650\/revisions"}],"predecessor-version":[{"id":4699,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/4650\/revisions\/4699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/4657"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=4650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=4650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=4650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}