[{"id":395508,"date":"2026-07-07T09:14:00","date_gmt":"2026-07-07T15:14:00","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395508"},"modified":"2026-07-07T09:14:05","modified_gmt":"2026-07-07T15:14:05","slug":"get-ready-for-the-powerful-css-border-shape-property","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/get-ready-for-the-powerful-css-border-shape-property\/","title":{"rendered":"Get Ready For the Powerful CSS border-shape Property!"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">So, we recently got the new <a href=\"https:\/\/css-tricks.com\/almanac\/functions\/s\/shape\/\"><code>shape()<\/code><\/a> function (now Baseline!) as well as the <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/c\/corner-shape\/\"><code>corner-shape<\/code><\/a> property. What else could we possibly need as far as making shapes in CSS? Let me tell you: the <code>border-shape<\/code> property!<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><code>shape()<\/code>? <code>corner-shape<\/code>? <code>border-shape<\/code>?! Where did all these come from?<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">If you are not a CSS shape fanatic like me, you probably missed these features when they came out, so let\u2019s give them brief, formal introductions, starting with\u2026<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 id=\"shape-and-cornershape\" class=\"wp-block-heading\"><code>shape()<\/code> and <code>corner-shape<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>shape()<\/code> function is a new value for <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/c\/clip-path\/\"><code>clip-path<\/code><\/a> and <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/o\/offset-path\/\"><code>offset-path<\/code><\/a> that uses SVG syntax to create CSS shapes much more easily than, say, <code>path()<\/code>. I wrote a <a href=\"https:\/\/css-tricks.com\/better-css-shapes-using-shape-part-1-lines-and-arcs\/\">four-article series<\/a> exploring this feature, and another article where I explore <a href=\"https:\/\/css-tricks.com\/complex-css-shapes-with-shape-function\/\">the creation of complex shapes<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1141\" height=\"325\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_8249102E6BD5A7D94BC02F00D913B3B576539AF394F7402EF7DE7C968CBF8D3E_1773225348617_image.png?resize=1141%2C325&#038;ssl=1\" alt=\"Three rectangular shapes with jagged, non-creating edges. the first is blue, then orange, then green.\" class=\"wp-image-395514\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_8249102E6BD5A7D94BC02F00D913B3B576539AF394F7402EF7DE7C968CBF8D3E_1773225348617_image.png?w=1141&amp;ssl=1 1141w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_8249102E6BD5A7D94BC02F00D913B3B576539AF394F7402EF7DE7C968CBF8D3E_1773225348617_image.png?resize=300%2C85&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_8249102E6BD5A7D94BC02F00D913B3B576539AF394F7402EF7DE7C968CBF8D3E_1773225348617_image.png?resize=1024%2C292&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_8249102E6BD5A7D94BC02F00D913B3B576539AF394F7402EF7DE7C968CBF8D3E_1773225348617_image.png?resize=768%2C219&amp;ssl=1 768w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Speaking about SVG, you can express any SVG shape using <code>shape()<\/code>. Said differently, you can <em>convert<\/em> any SVG shape into a CSS shape and, guess what, <a href=\"https:\/\/css-generators.com\/svg-to-css\/\" rel=\"noopener\">I made a converter that does exactly that<\/a>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As far as <code>corner-shape<\/code> goes, it\u2019s a property that works in conjunction with <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/b\/border-radius\/\"><code>border-radius<\/code><\/a>. As its name suggests, it allows you to control the shape of an element\u2019s corner using predefined keywords.<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.corner {\n  border-radius: 20px;\n  corner-shape: round | scoop | bevel | notch | squircle;\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"195\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/IqSM2bQw.png?resize=890%2C195&#038;ssl=1\" alt=\"A graphic displaying different CSS corner shapes: 'round', 'scoop', 'bevel', 'notch', and 'squircle', each in a purple background with white text.\" class=\"wp-image-395515\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/IqSM2bQw.png?w=890&amp;ssl=1 890w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/IqSM2bQw.png?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/IqSM2bQw.png?resize=768%2C168&amp;ssl=1 768w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It can also be used to create common CSS shapes, like I get into in another article, <a href=\"https:\/\/css-tip.com\/corner-shape\/\" rel=\"noopener\">\u201cCSS Shapes using <code>corner-shape<\/code>.<\/a><a href=\"https:\/\/css-tip.com\/corner-shape\/\" rel=\"noopener\">\u201d<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"884\" height=\"382\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/41EU6bMTR-884.png?resize=884%2C382&#038;ssl=1\" alt=\"CSS-only shapes (triangle, rhombus, hexagon, etc.)`\" class=\"wp-image-395517\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/41EU6bMTR-884.png?w=884&amp;ssl=1 884w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/41EU6bMTR-884.png?resize=300%2C130&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/41EU6bMTR-884.png?resize=768%2C332&amp;ssl=1 768w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">But is this the <code>corner-shape<\/code> property really useful or even needed? Except for the <code>squircle<\/code> value, most of the shapes can already be created using <code>clip-path<\/code> or <code>mask<\/code>. But what <code>corner-shape<\/code> does that these others can\u2019t is easily add borders and other decorations to those shapes!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"200\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/q8rLnLOp.png?resize=905%2C200&#038;ssl=1\" alt=\"Five shapes with different corner styles labeled: round, scoop, bevel, notch, and squircle, all displayed on a purple background.\" class=\"wp-image-395518\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/q8rLnLOp.png?w=905&amp;ssl=1 905w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/q8rLnLOp.png?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/q8rLnLOp.png?resize=768%2C170&amp;ssl=1 768w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>corner-shape<\/code> will not only shape the corners, but it also supports other properties like <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/b\/border\/\"><code>border<\/code><\/a> and <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/b\/box-shadow\/\"><code>box-shadow<\/code><\/a>, allowing them to follow the shape rather than the element\u2019s box. This is a game-changer because we all know that adding borders to shapes is a nightmare.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Support is still not great (Chromium-only as I\u2019m writing this), but it\u2019s a good time to explore it and get an overview of its potential.<\/p>\n\n\n\n\n<baseline-status class=\"wp-block-css-tricks-baseline-status\" featureId=\"corner-shape\"><\/baseline-status>\n\n\n\n<h2 id=\"enter-bordershape\" class=\"wp-block-heading\">Enter <code>border-shape<\/code>!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Shaping corners is good, but it\u2019s still fairly limited as far as what we can do with it. Like, what about shaping the whole element instead? That\u2019s what <code>border-shape<\/code> will do. It accepts the same values as <code>clip-path<\/code>, including the new <code>shape()<\/code> function.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">So, it has the same job as <code>clip-path<\/code>? What\u2019s new?<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Like with <code>corner-shape<\/code>, most decorative properties such as <code>border<\/code>, <code>box-shadow<\/code>, and <code>outline<\/code> follow the shape.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"331\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/UwwhSpo2xk-891.png?resize=891%2C331&#038;ssl=1\" alt=\"Showing the difference between clip-path and border-shape\" class=\"wp-image-395520\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/UwwhSpo2xk-891.png?w=891&amp;ssl=1 891w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/UwwhSpo2xk-891.png?resize=300%2C111&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/UwwhSpo2xk-891.png?resize=768%2C285&amp;ssl=1 768w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>clip-path<\/code> (and <code>mask<\/code>) will <a href=\"https:\/\/css-tricks.com\/clipping-masking-css\/\">clip\/mask<\/a> the whole element, including the decorations, so having borders is a big <em>NO<\/em>. That\u2019s a major problem for creating CSS shapes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>border-shape<\/code> property is here to solve this issue. Instead of clipping the element, it \u201cshapes\u201d the element, allowing its decorations to follow that shape. In other words, putting borders on CSS shapes will become child\u2019s play!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not to mention that <code>border-shape<\/code> is also very easy to use. If you are familiar with <code>clip-path<\/code>, then you practically have nothing new to learn. Simply replace one property with another, and you are done.<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.shape {\n  \/* Old code *\/\n  clip-path: shape() | polygon() | ...;\n\n  \/* New code *\/\n  border-shape: shape() | polygon() | ...;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I invite you again to learn more about the <code>shape()<\/code> function because it\u2019s the value that makes <code>border-shape<\/code> really powerful. The two really go hand-in-hand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you know the basic use of the property, shall we start the fun stuff? I are here to push the limits and show you what is possible using <code>border-shape<\/code>.<\/p>\n\n\n\n<p class=\"is-style-explanation wp-block-paragraph\"><strong>Note:<\/strong> Support is limited to Chrome-only for now so check out the next demos using Chrome.<\/p>\n\n\n\n\n<baseline-status class=\"wp-block-css-tricks-baseline-status\" featureId=\"border-shape\"><\/baseline-status>\n\n\n\n<h2 id=\"borderonly-shapes\" class=\"wp-block-heading\">Border-Only Shapes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As I said, the first major advantage here is adding borders to shapes that follow the actual shape, which also means the ability to create border-only shapes. All you have to do is write the following code:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.shape {\n  border: 8px solid red;\n  border-shape: \/* your shape code *\/;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/css-tricks.com\/the-shapes-of-css\/\">No more hacks<\/a> and no more headaches!<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_myOpBpX\/e90357a6ccd70121313a49ab41c37dc3\" src=\"\/\/codepen.io\/anon\/embed\/myOpBpX\/e90357a6ccd70121313a49ab41c37dc3?height=600&amp;theme-id=1&amp;slug-hash=myOpBpX\/e90357a6ccd70121313a49ab41c37dc3&amp;default-tab=result\" height=\"600\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed myOpBpX\/e90357a6ccd70121313a49ab41c37dc3\" title=\"CodePen Embed myOpBpX\/e90357a6ccd70121313a49ab41c37dc3\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"2154\" height=\"476\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?resize=2154%2C476&#038;ssl=1\" alt=\"Four shapes with borders and no fill, including a red heart, yellow starburst, green flower, and blue jagged rectangle. \" class=\"wp-image-395523\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?w=2154&amp;ssl=1 2154w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?resize=1024%2C226&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?resize=768%2C170&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?resize=1536%2C339&amp;ssl=1 1536w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500113996_Screenshot2026-06-03at9.21.27AM.png?resize=2048%2C453&amp;ssl=1 2048w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Most of the shapes are already available in my <a href=\"https:\/\/css-shape.com\/\" rel=\"noopener\">CSS Shapes collection<\/a>, so really, making border-only shapes is something you can do with a simple copy\/paste. Even some of <a href=\"https:\/\/css-generators.com\/\" rel=\"noopener\">my online generators<\/a> are already configured to provide border-only versions of complex shapes, like blobs, wavy lines, and fancy frames, among many, many others.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1136\" height=\"308\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s5aX9SWN4Z-1136.png?resize=1136%2C308&#038;ssl=1\" alt=\"border-only shapes using the CSS border-shape property, including a jagged red circle, a squiggly blue line, and a jagged blue rectangle.\" class=\"wp-image-395525\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s5aX9SWN4Z-1136.png?w=1136&amp;ssl=1 1136w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s5aX9SWN4Z-1136.png?resize=300%2C81&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s5aX9SWN4Z-1136.png?resize=1024%2C278&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s5aX9SWN4Z-1136.png?resize=768%2C208&amp;ssl=1 768w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<h2 id=\"cutout-shapes\" class=\"wp-block-heading\">Cutout Shapes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s take the previous code and update it as follows:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.shape {\n  border: 8px solid red;\n  border-shape: inset(0) \/* you shape code *\/;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You keep the shape code you had, and you add <a href=\"https:\/\/css-tricks.com\/almanac\/functions\/i\/inset\/\"><code>inset(0)<\/code><\/a> at the beginning. Yes, you can have two shape values inside <code>border-shape<\/code> and the result will be as follows:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_QwGaqBP\/08c7d871cd5de941605ba89f8d5558ed\" src=\"\/\/codepen.io\/anon\/embed\/QwGaqBP\/08c7d871cd5de941605ba89f8d5558ed?height=600&amp;theme-id=1&amp;slug-hash=QwGaqBP\/08c7d871cd5de941605ba89f8d5558ed&amp;default-tab=result\" height=\"600\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed QwGaqBP\/08c7d871cd5de941605ba89f8d5558ed\" title=\"CodePen Embed QwGaqBP\/08c7d871cd5de941605ba89f8d5558ed\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1968\" height=\"484\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500729455_Screenshot2026-06-03at9.31.50AM.png?resize=1968%2C484&#038;ssl=1\" alt=\"Four shapes cut out from squares with filled colors, including a heart with red background, a stardust against yellow, a flower against green, and a jagged square against blue.\" class=\"wp-image-395527\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500729455_Screenshot2026-06-03at9.31.50AM.png?w=1968&amp;ssl=1 1968w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500729455_Screenshot2026-06-03at9.31.50AM.png?resize=300%2C74&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500729455_Screenshot2026-06-03at9.31.50AM.png?resize=1024%2C252&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500729455_Screenshot2026-06-03at9.31.50AM.png?resize=768%2C189&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500729455_Screenshot2026-06-03at9.31.50AM.png?resize=1536%2C378&amp;ssl=1 1536w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">From <a href=\"https:\/\/drafts.csswg.org\/css-borders-4\/#border-shape-syntax\" rel=\"noopener\">the specification<\/a>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">The <code>border-shape<\/code> property accepts either a single <code>&lt;basic-shape&gt;<\/code> or two <code>&lt;basic-shape&gt;<\/code>s:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Single <a href=\"https:\/\/www.w3.org\/TR\/css-shapes-1\/#typedef-basic-shape\" rel=\"noopener\"><code>&lt;basic-shape&gt;<\/code><\/a> (Stroke mode):<\/strong> The border is rendered as a stroke along the shape\u2019s path, with the stroke width determined by the relevant side\u2019s computed border width. This mode is useful for creating outlined shapes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Two <a href=\"https:\/\/www.w3.org\/TR\/css-shapes-1\/#typedef-basic-shape\" rel=\"noopener\"><code>&lt;basic-shape&gt;<\/code><\/a>s (Fill mode)<\/strong> The border is rendered as the area between the two paths. The first shape defines the outer boundary, and the second shape defines the inner boundary. This mode provides precise control over the border region\u2019s geometry.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Using a basic rectangle as the outer shape (<code>inset(0)<\/code>), I was able to easily transform the border-only version into a cutout version!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do you want the shape inside a circle? Easy!<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_LEbezMj\/7433780c96c4a18f40baa1967ad4b980\" src=\"\/\/codepen.io\/anon\/embed\/LEbezMj\/7433780c96c4a18f40baa1967ad4b980?height=600&amp;theme-id=1&amp;slug-hash=LEbezMj\/7433780c96c4a18f40baa1967ad4b980&amp;default-tab=result\" height=\"600\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed LEbezMj\/7433780c96c4a18f40baa1967ad4b980\" title=\"CodePen Embed LEbezMj\/7433780c96c4a18f40baa1967ad4b980\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"320\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500785441_Screenshot2026-06-03at9.32.47AM.png?resize=1024%2C320&#038;ssl=1\" alt=\"Four shapes cut out from circles with filled colors, including a heart with red background, a stardust against yellow, a flower against green, and a jagged square against blue.\" class=\"wp-image-395530\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500785441_Screenshot2026-06-03at9.32.47AM.png?resize=1024%2C320&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500785441_Screenshot2026-06-03at9.32.47AM.png?resize=300%2C94&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500785441_Screenshot2026-06-03at9.32.47AM.png?resize=768%2C240&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500785441_Screenshot2026-06-03at9.32.47AM.png?resize=1536%2C480&amp;ssl=1 1536w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500785441_Screenshot2026-06-03at9.32.47AM.png?w=1568&amp;ssl=1 1568w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All I did is replace <code>inset(0)<\/code> (a rectangle) with <code>circle()<\/code> (a circle).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">But we can do this with a simple <code>border-radius: 50%<\/code>, right?<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">No! When working with <code>border-shape<\/code>, the <code>border-radius<\/code> is ignored, which is kind of logical since we no longer have corners to round \u2014 the element is now shaped. This is not a big deal since we can literally create any kind of shape that replaces the use of <code>border-radius<\/code>, as shown in the previous example.<\/p>\n\n\n\n<p class=\"is-style-explanation wp-block-paragraph\"><strong>Note:<\/strong> If you are wondering why I am using <code>circle()<\/code>without any argument, check out my article <a href=\"https:\/\/css-tip.com\/css-functions\/\" rel=\"noopener\">\u201cCSS Functions that work without arguments<\/a><a href=\"https:\/\/css-tip.com\/css-functions\/\" rel=\"noopener\">.<\/a><a href=\"https:\/\/css-tip.com\/css-functions\/\" rel=\"noopener\">\u201d<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are a few more examples with the two shapes value to look at before we move to the next part:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_myOpqKY\/0ae06ea7e647c0a7d6238d728e8a2584\" src=\"\/\/codepen.io\/anon\/embed\/myOpqKY\/0ae06ea7e647c0a7d6238d728e8a2584?height=600&amp;theme-id=1&amp;slug-hash=myOpqKY\/0ae06ea7e647c0a7d6238d728e8a2584&amp;default-tab=result\" height=\"600\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed myOpqKY\/0ae06ea7e647c0a7d6238d728e8a2584\" title=\"CodePen Embed myOpqKY\/0ae06ea7e647c0a7d6238d728e8a2584\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1592\" height=\"486\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500926571_Screenshot2026-06-03at9.35.04AM.png?resize=1592%2C486&#038;ssl=1\" alt=\"Four shapes cut out from polygons with filled colors, including a heart with red background, a stardust against yellow, a flower against green, and a jagged square against blue.\" class=\"wp-image-395532\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500926571_Screenshot2026-06-03at9.35.04AM.png?w=1592&amp;ssl=1 1592w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500926571_Screenshot2026-06-03at9.35.04AM.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500926571_Screenshot2026-06-03at9.35.04AM.png?resize=1024%2C313&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500926571_Screenshot2026-06-03at9.35.04AM.png?resize=768%2C234&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780500926571_Screenshot2026-06-03at9.35.04AM.png?resize=1536%2C469&amp;ssl=1 1536w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can literally use any combination to get complex-looking shapes without a bunch of effort!<\/p>\n\n\n\n<h2 id=\"breakout-decorations\" class=\"wp-block-heading\">Breakout Decorations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s take a block of text and apply the previous code with the two shape values:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.box {\n  border-shape: inset(0) circle();\n  border-color: pink;\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_JobMOaB\/d7e5dcb366523a4e0484ef4a50b5aac8\" src=\"\/\/codepen.io\/anon\/embed\/JobMOaB\/d7e5dcb366523a4e0484ef4a50b5aac8?height=450&amp;theme-id=1&amp;slug-hash=JobMOaB\/d7e5dcb366523a4e0484ef4a50b5aac8&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed JobMOaB\/d7e5dcb366523a4e0484ef4a50b5aac8\" title=\"CodePen Embed JobMOaB\/d7e5dcb366523a4e0484ef4a50b5aac8\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Perhaps this is nothing surprising considering what we have learned so far. We define two shapes and the border is drawn inside the area between them. What\u2019s new here is that we are dealing with content and, as you can see, it overlaps the border.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>border-shape<\/code> shapes the <em>whole<\/em> element, including the element\u2019s decoration, but any content inside remains unchanged and follows the initial rectangle shape. That\u2019s not new behavior since the same happens even even with classic <code>border-radius<\/code>. And the content will overflow unless we decide to hide it using <code>overflow hidden<\/code>.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_vEydBQW\/a19a3abf94277f25bc86cdb810859034\" src=\"\/\/codepen.io\/anon\/embed\/vEydBQW\/a19a3abf94277f25bc86cdb810859034?height=450&amp;theme-id=1&amp;slug-hash=vEydBQW\/a19a3abf94277f25bc86cdb810859034&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed vEydBQW\/a19a3abf94277f25bc86cdb810859034\" title=\"CodePen Embed vEydBQW\/a19a3abf94277f25bc86cdb810859034\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">In this case, I won\u2019t consider the <code>overflow<\/code> property as I want the content to overflow and be placed on top of the border decoration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s update the code of the shape like this:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.box {\n  border-shape: inset(0 -100px) circle(50px);\n  border-color: pink;\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_ogYpoQQ\/0a4234c433fd23d78fc07b9bf232f79b\" src=\"\/\/codepen.io\/anon\/embed\/ogYpoQQ\/0a4234c433fd23d78fc07b9bf232f79b?height=450&amp;theme-id=1&amp;slug-hash=ogYpoQQ\/0a4234c433fd23d78fc07b9bf232f79b&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed ogYpoQQ\/0a4234c433fd23d78fc07b9bf232f79b\" title=\"CodePen Embed ogYpoQQ\/0a4234c433fd23d78fc07b9bf232f79b\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">I made the circle smaller and the rectangle bigger. Do you see where I am going? By making the radius of the circle <code>0<\/code> and the rectangle bigger, I create a breakout background effect!<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">.box {\n  border-shape: inset(0 -100vw) circle(0);\n  border-color: pink;\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_jEVYaXV\/de8cc0ac037c351f0d2c7bd358334380\" src=\"\/\/codepen.io\/anon\/embed\/jEVYaXV\/de8cc0ac037c351f0d2c7bd358334380?height=450&amp;theme-id=1&amp;slug-hash=jEVYaXV\/de8cc0ac037c351f0d2c7bd358334380&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed jEVYaXV\/de8cc0ac037c351f0d2c7bd358334380\" title=\"CodePen Embed jEVYaXV\/de8cc0ac037c351f0d2c7bd358334380\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1790\" height=\"684\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502283260_Screenshot2026-06-03at9.57.38AM.png?resize=1790%2C684&#038;ssl=1\" alt=\"A paragraph of black text against a full-width pink rectangle.\" class=\"wp-image-395535\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502283260_Screenshot2026-06-03at9.57.38AM.png?w=1790&amp;ssl=1 1790w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502283260_Screenshot2026-06-03at9.57.38AM.png?resize=300%2C115&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502283260_Screenshot2026-06-03at9.57.38AM.png?resize=1024%2C391&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502283260_Screenshot2026-06-03at9.57.38AM.png?resize=768%2C293&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502283260_Screenshot2026-06-03at9.57.38AM.png?resize=1536%2C587&amp;ssl=1 1536w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The element remains centered, but its background (that we are simulating using a border!) extends to the edge of the screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And this is not limited to using two shape values. Even with the one shape value, we can achieve a breakout decoration (<a href=\"https:\/\/css-tricks.com\/breaking-css-grid-explained\/\">which is typically difficult<\/a>) if you consider any value that gets you out of the element\u2019s boundary.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a demo with many examples that I\u2019ll let you explore:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_XJNJRLw\/81b35ba88e6ef15b521ef04259aa69a5\" src=\"\/\/codepen.io\/anon\/embed\/XJNJRLw\/81b35ba88e6ef15b521ef04259aa69a5?height=450&amp;theme-id=1&amp;slug-hash=XJNJRLw\/81b35ba88e6ef15b521ef04259aa69a5&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed XJNJRLw\/81b35ba88e6ef15b521ef04259aa69a5\" title=\"CodePen Embed XJNJRLw\/81b35ba88e6ef15b521ef04259aa69a5\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"2118\" height=\"1362\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?resize=2118%2C1362&#038;ssl=1\" alt=\"Three examples of border text decorations, including an orange line through a main heading, heading against a blue caret-shaped background, and black text against a full-width pink background.\" class=\"wp-image-395536\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?w=2118&amp;ssl=1 2118w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?resize=300%2C193&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?resize=1024%2C658&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?resize=768%2C494&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?resize=1536%2C988&amp;ssl=1 1536w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502455729_Screenshot2026-06-03at10.00.29AM.png?resize=2048%2C1317&amp;ssl=1 2048w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<h2 id=\"partial-decorations\" class=\"wp-block-heading\">Partial Decorations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s piggy-back off that last demo to try different decorations.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_NPbXXWb\/5940b118b0f317344f7c8ee6c4d76dd8\" src=\"\/\/codepen.io\/anon\/embed\/NPbXXWb\/5940b118b0f317344f7c8ee6c4d76dd8?height=450&amp;theme-id=1&amp;slug-hash=NPbXXWb\/5940b118b0f317344f7c8ee6c4d76dd8&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed NPbXXWb\/5940b118b0f317344f7c8ee6c4d76dd8\" title=\"CodePen Embed NPbXXWb\/5940b118b0f317344f7c8ee6c4d76dd8\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1792\" height=\"1340\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502638128_Screenshot2026-06-03at10.03.27AM.png?resize=1792%2C1340&#038;ssl=1\" alt=\"Three examples of border text decorations, including a short orange underline for a mina heading, a heading with a partial blue background with a diagonal right edge, and a corner border in the top-left of a paragraph.\" class=\"wp-image-395537\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502638128_Screenshot2026-06-03at10.03.27AM.png?w=1792&amp;ssl=1 1792w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502638128_Screenshot2026-06-03at10.03.27AM.png?resize=300%2C224&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502638128_Screenshot2026-06-03at10.03.27AM.png?resize=1024%2C766&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502638128_Screenshot2026-06-03at10.03.27AM.png?resize=768%2C574&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/s_41D9CEBA3456427DA5CBB280F83080BD1DFA1200838C0E38169BFC78A1CD67F7_1780502638128_Screenshot2026-06-03at10.03.27AM.png?resize=1536%2C1149&amp;ssl=1 1536w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This time, instead of extending outside the element boundary, I am staying within it to create partial decoration. In other words, we no longer have boundaries. <code>border-shape<\/code> has no limit. The only limit is your imagination!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am mainly relying on the <code>shape()<\/code> function to create the decoration, so do yourself a favor and explore this feature by reading my <a href=\"https:\/\/css-tricks.com\/better-css-shapes-using-shape-part-1-lines-and-arcs\/\">four-article series<\/a>! If you master <code>shape()<\/code>, you can easily produce complex decorations using <code>border-shape<\/code>.<\/p>\n\n\n\n<h2 id=\"shape-animation\" class=\"wp-block-heading\">Shape Animation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, <code>border-shape<\/code> can be animated, and we can have different kinds of animations. With the two-value syntax, we can animate the <code>border-width<\/code> value to create a reveal effect:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hover the below and see the result:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_qEqpYmG\/7bd756d1608487b94007070da97b2cab\" src=\"\/\/codepen.io\/anon\/embed\/qEqpYmG\/7bd756d1608487b94007070da97b2cab?height=600&amp;theme-id=1&amp;slug-hash=qEqpYmG\/7bd756d1608487b94007070da97b2cab&amp;default-tab=result\" height=\"600\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed qEqpYmG\/7bd756d1608487b94007070da97b2cab\" title=\"CodePen Embed qEqpYmG\/7bd756d1608487b94007070da97b2cab\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Cool, right? We can also apply this to image elements as well:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_WbodJdZ\/8d63aded6f3f1745feeb61f7432de70e\" src=\"\/\/codepen.io\/anon\/embed\/WbodJdZ\/8d63aded6f3f1745feeb61f7432de70e?height=600&amp;theme-id=1&amp;slug-hash=WbodJdZ\/8d63aded6f3f1745feeb61f7432de70e&amp;default-tab=result\" height=\"600\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed WbodJdZ\/8d63aded6f3f1745feeb61f7432de70e\" title=\"CodePen Embed WbodJdZ\/8d63aded6f3f1745feeb61f7432de70e\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We can also animate the shape values to create more complex animations. Here is a demo of a bouncing hover effect applied to blob shapes (from my article <a href=\"https:\/\/css-tricks.com\/complex-css-shapes-with-shape-function\/\">&#8220;Making Complex CSS Shapes Using <code>shape()<\/code>.&#8221;<\/a><\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_yyyPONb\" src=\"\/\/codepen.io\/anon\/embed\/yyyPONb?height=450&amp;theme-id=1&amp;slug-hash=yyyPONb&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed yyyPONb\" title=\"CodePen Embed yyyPONb\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">I take the same code, replace <code>clip-path<\/code> with <code>border-shape<\/code>, and <em>tada<\/em>!<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_GgNyddj\/3f67b71f0946ba4f941d9ba5defc9c0b\" src=\"\/\/codepen.io\/anon\/embed\/GgNyddj\/3f67b71f0946ba4f941d9ba5defc9c0b?height=450&amp;theme-id=1&amp;slug-hash=GgNyddj\/3f67b71f0946ba4f941d9ba5defc9c0b&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed GgNyddj\/3f67b71f0946ba4f941d9ba5defc9c0b\" title=\"CodePen Embed GgNyddj\/3f67b71f0946ba4f941d9ba5defc9c0b\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">And why not add a subtle animation to those previous decorations? Hover the titles and the text to see what happens:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_GgNyBmz\/a497397c4ba86e88114ceed208c1ca43\" src=\"\/\/codepen.io\/anon\/embed\/GgNyBmz\/a497397c4ba86e88114ceed208c1ca43?height=650&amp;theme-id=1&amp;slug-hash=GgNyBmz\/a497397c4ba86e88114ceed208c1ca43&amp;default-tab=result\" height=\"650\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed GgNyBmz\/a497397c4ba86e88114ceed208c1ca43\" title=\"CodePen Embed GgNyBmz\/a497397c4ba86e88114ceed208c1ca43\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 id=\"want-more-lets-go\" class=\"wp-block-heading\">Want More? Let\u2019s Go!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a <a href=\"https:\/\/css-tip.com\/hand-drawn-underline\/\" rel=\"noopener\">hand-drawn underline<\/a> that slides between the menu items on hover. Straight lines are boring!<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_emdoVae\" src=\"\/\/codepen.io\/anon\/embed\/emdoVae?height=450&amp;theme-id=1&amp;slug-hash=emdoVae&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed emdoVae\" title=\"CodePen Embed emdoVae\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">And why not an electric frame around your content? Don\u2019t worry, it\u2019s safe for touch screens.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_LEbPJow\/dd6ad605878e5341d8d9163ed8fbad5f\" src=\"\/\/codepen.io\/anon\/embed\/LEbPJow\/dd6ad605878e5341d8d9163ed8fbad5f?height=550&amp;theme-id=1&amp;slug-hash=LEbPJow\/dd6ad605878e5341d8d9163ed8fbad5f&amp;default-tab=result\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed LEbPJow\/dd6ad605878e5341d8d9163ed8fbad5f\" title=\"CodePen Embed LEbPJow\/dd6ad605878e5341d8d9163ed8fbad5f\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">What about a fancy border-only loader? (code taken from <a href=\"https:\/\/css-loaders.com\/squishy\/\" rel=\"noopener\">my squishy loader collection<\/a>)<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_YPpYLvy\/3bca6c53256887740497dbfd09633b60\" src=\"\/\/codepen.io\/anon\/embed\/YPpYLvy\/3bca6c53256887740497dbfd09633b60?height=450&amp;theme-id=1&amp;slug-hash=YPpYLvy\/3bca6c53256887740497dbfd09633b60&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed YPpYLvy\/3bca6c53256887740497dbfd09633b60\" title=\"CodePen Embed YPpYLvy\/3bca6c53256887740497dbfd09633b60\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s <a href=\"https:\/\/css-tip.com\/bending-line\/\" rel=\"noopener\">connect circles<\/a> with a straight line that bends when the circles get closer and stretches when they get farther. Drag the circles in the demo below and see the magic in play:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_yyVPKzb\" src=\"\/\/codepen.io\/anon\/embed\/yyVPKzb?height=450&amp;theme-id=1&amp;slug-hash=yyVPKzb&amp;default-tab=result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed yyVPKzb\" title=\"CodePen Embed yyVPKzb\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 id=\"conclusion\" class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I think it\u2019s clear now why I am calling this new property \u201cpowerful.\u201d In addition to making it easy to create CSS shapes, it lets us add fancy decorations, cool animations, and more!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I didn\u2019t go into fine detail with most of the demos as I wanted to keep this a light article showing the potential of <code>border-shape<\/code>. Now that you know we can create crazy stuff with it, stay tuned for more elaborate articles!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t forget to bookmark my <a href=\"https:\/\/css-shape.com\/\" rel=\"noopener\">CSS Shapes collection<\/a> and <a href=\"https:\/\/css-generators.com\/\" rel=\"noopener\">my online generators<\/a>. I have already updated many of the shapes using <code>shape()<\/code>, and I am in the process of also including the <code>border-shape<\/code> version.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We recently got the <code>shape()<\/code> function and <code>corner-shape<\/code> property. What else could we possibly need as far as making shapes in CSS? Let me tell you: the <code>border-shape<\/code> property!<\/p>\n","protected":false},"author":281881,"featured_media":395539,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[19126,4953,1550],"class_list":["post-395508","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-border-shape","tag-borders","tag-css-shapes"],"acf":{"show_toc":"Yes"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/css-border-shape-examples.jpg?fit=1150%2C552&ssl=1","jetpack-related-posts":[{"id":392503,"url":"https:\/\/css-tricks.com\/experimenting-with-scroll-driven-corner-shape-animations\/","url_meta":{"origin":395508,"position":0},"title":"Experimenting With Scroll-Driven corner-shape Animations","author":"Daniel Schwarz","date":"March 23, 2026","format":false,"excerpt":"The new CSS corner-shape() property is mathematical, so it\u2019s easily animated. Author Daniel Schwarz pokes at animating the property for interesting UI effects.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/corner-shape-animation.webp?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/corner-shape-animation.webp?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/corner-shape-animation.webp?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/corner-shape-animation.webp?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/corner-shape-animation.webp?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":353391,"url":"https:\/\/css-tricks.com\/exploring-the-css-paint-api-rounding-shapes\/","url_meta":{"origin":395508,"position":1},"title":"Exploring the CSS Paint API: Rounding Shapes","author":"Temani Afif","date":"October 22, 2021","format":false,"excerpt":"Adding borders to complex shapes is a pain, but rounding the corner of complex shapes is a nightmare! Luckily, the CSS Paint API is here to the rescue! That\u2019s what we\u2019re going to look at as part of this \u201cExploring the CSS Paint API\u201d series. Exploring the CSS Paint API\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/10\/header-rounding-shapes.png?fit=1031%2C465&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/10\/header-rounding-shapes.png?fit=1031%2C465&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/10\/header-rounding-shapes.png?fit=1031%2C465&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/10\/header-rounding-shapes.png?fit=1031%2C465&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":345274,"url":"https:\/\/css-tricks.com\/using-css-shapes-for-interesting-user-controls-and-navigation\/","url_meta":{"origin":395508,"position":2},"title":"Using CSS Shapes for Interesting User Controls and Navigation","author":"Preethi","date":"August 4, 2021","format":false,"excerpt":"Straight across or down, that\u2019s the proverbial order for user controls on a screen. Like a list of menu items. But what if we change that to a more fluid layout with bends, curves, and nooks? We can pull it off with just a few lines of code. In the\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/07\/shape-outside-navigation.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/07\/shape-outside-navigation.jpg?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/07\/shape-outside-navigation.jpg?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/07\/shape-outside-navigation.jpg?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/07\/shape-outside-navigation.jpg?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":387089,"url":"https:\/\/css-tricks.com\/css-blob-recipes\/","url_meta":{"origin":395508,"position":3},"title":"CSS Blob Recipes","author":"Juan Diego Rodr\u00edguez","date":"June 27, 2025","format":false,"excerpt":"Blob, Blob, Blob. What's the most effective way to create blob shapes in CSS? Turns out, as always, there are many. Let's compare them together!","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/06\/blobs-cover.webp?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/06\/blobs-cover.webp?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/06\/blobs-cover.webp?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/06\/blobs-cover.webp?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/06\/blobs-cover.webp?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":391573,"url":"https:\/\/css-tricks.com\/responsive-hexagon-grid-using-modern-css\/","url_meta":{"origin":395508,"position":4},"title":"Responsive Hexagon Grid Using Modern CSS","author":"Temani Afif","date":"January 23, 2026","format":false,"excerpt":"A while back, Temani tacked a repeating grid of hexagon shapes. Well, he's updated it with modern CSS features that result in fewer magic numbers. And it's impressive!","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"A grid of hexagon shapes of equal size that alternate between blue and red. Each shape is labelled by it's order in the grid.","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/hexagon-grid.png?fit=1200%2C570&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/hexagon-grid.png?fit=1200%2C570&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/hexagon-grid.png?fit=1200%2C570&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/hexagon-grid.png?fit=1200%2C570&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/hexagon-grid.png?fit=1200%2C570&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":389060,"url":"https:\/\/css-tricks.com\/what-can-we-actually-do-with-corner-shape\/","url_meta":{"origin":395508,"position":5},"title":"What Can We Actually Do With corner-shape?","author":"Daniel Schwarz","date":"September 12, 2025","format":false,"excerpt":"When I first started messing around with code, rounded corners required five background images or an image sprite likely created in Photoshop, so when border-radius came onto the scene, I remember everybody thinking that it was the best thing ever. Web designs were very square at the time, so to\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/09\/s_B9520AAEB8E72143A2990CEB07209D80D9AD692AC1F43B71E4BC9C84D7184887_1757081374239_Screenshot2025-09-05at8.08.39AM.png?fit=1200%2C660&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/09\/s_B9520AAEB8E72143A2990CEB07209D80D9AD692AC1F43B71E4BC9C84D7184887_1757081374239_Screenshot2025-09-05at8.08.39AM.png?fit=1200%2C660&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/09\/s_B9520AAEB8E72143A2990CEB07209D80D9AD692AC1F43B71E4BC9C84D7184887_1757081374239_Screenshot2025-09-05at8.08.39AM.png?fit=1200%2C660&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/09\/s_B9520AAEB8E72143A2990CEB07209D80D9AD692AC1F43B71E4BC9C84D7184887_1757081374239_Screenshot2025-09-05at8.08.39AM.png?fit=1200%2C660&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/09\/s_B9520AAEB8E72143A2990CEB07209D80D9AD692AC1F43B71E4BC9C84D7184887_1757081374239_Screenshot2025-09-05at8.08.39AM.png?fit=1200%2C660&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/281881"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395508"}],"version-history":[{"count":9,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395508\/revisions"}],"predecessor-version":[{"id":395953,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395508\/revisions\/395953"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/395539"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395949,"date":"2026-07-07T09:10:39","date_gmt":"2026-07-07T15:10:39","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395949"},"modified":"2026-07-07T09:10:43","modified_gmt":"2026-07-07T15:10:43","slug":"quick-hit-159","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-159\/","title":{"rendered":"Quick Hit #159"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.firefox.com\/en-GB\/firefox\/154.0a1\/releasenotes\/\" rel=\"noopener\">Firefox 154<\/a> (Nightly) will ship <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/t\/text-box\/\"><code>text-box<\/code><\/a>, <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/t\/text-box-trim\/\"><code>text-box-trim<\/code><\/a>, and <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/t\/text-box-edge\/\"><code>text-box-edge<\/code><\/a>, making them Baseline.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firefox 154 (Nightly) will ship text-box, text-box-trim, and text-box-edge, making them Baseline.<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[478,1471,19182],"class_list":["post-395949","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-css","tag-firefox","tag-text-box"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":380589,"url":"https:\/\/css-tricks.com\/two-css-properties-for-trimming-text-box-whitespace\/","url_meta":{"origin":395949,"position":0},"title":"Two CSS Properties for Trimming Text Box Whitespace","author":"Daniel Schwarz","date":"September 13, 2024","format":false,"excerpt":"The\u00a0text-box-trim\u00a0and\u00a0text-box-edge properties in CSS enable developers to trim specifiable amounts of the whitespace that appear above the first formatted line of text and below the last formatted line of text in a text box, making the text box vertically larger than the content within. This whitespace is called\u00a0leading, and it\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/09\/whitespace.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/09\/whitespace.jpg?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/09\/whitespace.jpg?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/09\/whitespace.jpg?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/09\/whitespace.jpg?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":388812,"url":"https:\/\/css-tricks.com\/quick-hit-55\/","url_meta":{"origin":395949,"position":1},"title":"Quick Hit #55","author":"Geoff Graham","date":"August 18, 2025","format":false,"excerpt":"Really good to see Firefox Nightly join in the URL text fragments fun. Looks like we'll have broad support super soon!","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":390681,"url":"https:\/\/css-tricks.com\/text-decoration-inset-is-like-padding-for-text-decorations\/","url_meta":{"origin":395949,"position":2},"title":"text-decoration-inset is Like Padding for Text Decorations","author":"Daniel Schwarz","date":"December 22, 2025","format":false,"excerpt":"The text-decoration-inset property solves a problem that we\u2019ve had since the beginning of the web, which is that text decorations such as underlines extend beyond the first and last characters, resulting in vertical misalignment.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-22-at-7.41.21-AM.png?fit=1200%2C567&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-22-at-7.41.21-AM.png?fit=1200%2C567&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-22-at-7.41.21-AM.png?fit=1200%2C567&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-22-at-7.41.21-AM.png?fit=1200%2C567&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-22-at-7.41.21-AM.png?fit=1200%2C567&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":391155,"url":"https:\/\/css-tricks.com\/quick-hit-72\/","url_meta":{"origin":395949,"position":3},"title":"Quick Hit #72","author":"Daniel Schwarz","date":"December 17, 2025","format":false,"excerpt":"Firefox 146\u00a0ships\u00a0text-decoration-inset, which enables us to customize the position and size of text decorations such as underlines.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":339518,"url":"https:\/\/css-tricks.com\/is-vendor-prefixing-dead\/","url_meta":{"origin":395949,"position":4},"title":"Is Vendor Prefixing Dead?","author":"Rob O'Leary","date":"May 5, 2021","format":false,"excerpt":"Let\u2018s take a quick stroll down memory-lane to revisit how vendor prefixing CSS properties came to be. I hope I don\u2019t trigger PTSD for anyone! It\u2018s not clear who started prefixing, or when it began exactly. What is clear, is that by 2006, prefixed features were in Internet Explorer and\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/prefixing-history.png?fit=988%2C506&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/prefixing-history.png?fit=988%2C506&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/prefixing-history.png?fit=988%2C506&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/prefixing-history.png?fit=988%2C506&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":155648,"url":"https:\/\/css-tricks.com\/multi-line-padded-text\/","url_meta":{"origin":395949,"position":5},"title":"Multi-Line Padded Text","author":"Chris Coyier","date":"November 12, 2013","format":false,"excerpt":"This is one of those tricky CSS things that I see come up every few months. I guess what better place to address it than CSS-Tricks eh? Update: Your best bet is to use the box-decoration-break property, which is currently supported by all modern browsers, except Safari which does support\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395949"}],"version-history":[{"count":2,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395949\/revisions"}],"predecessor-version":[{"id":395951,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395949\/revisions\/395951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395946,"date":"2026-07-06T10:25:26","date_gmt":"2026-07-06T16:25:26","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395946"},"modified":"2026-07-06T10:25:29","modified_gmt":"2026-07-06T16:25:29","slug":"quick-hit-158","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-158\/","title":{"rendered":"Quick Hit #158"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/webkit.org\/blog\/18133\/release-notes-for-safari-technology-preview-247\/\" rel=\"noopener\">Safari TP 247<\/a> becomes the first to trial <a href=\"https:\/\/www.w3.org\/TR\/css-values-5\/#calc-mix\" rel=\"noopener\"><code>calc-mix()<\/code><\/a>, which returns a progress point between two values.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Safari TP 247 becomes the first to trial calc-mix(), which returns a progress point between two values.<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[1219,19181,478,1372],"class_list":["post-395946","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-calc","tag-calc-mix","tag-css","tag-safari"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":21838,"url":"https:\/\/css-tricks.com\/a-couple-of-use-cases-for-calc\/","url_meta":{"origin":395946,"position":0},"title":"A Couple of Use Cases for Calc()","author":"Chris Coyier","date":"June 5, 2013","format":false,"excerpt":"calc() is a native CSS way to do simple math right in CSS as a replacement for any length value (or pretty much any number value). It has four simple math operators: add (+), subtract (-), multiply (*), and divide (\/). Being able to do math in code is nice\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":263206,"url":"https:\/\/css-tricks.com\/animating-border\/","url_meta":{"origin":395946,"position":1},"title":"Animating Border","author":"Stephen Shaw","date":"December 5, 2017","format":false,"excerpt":"Transitioning border for a hover state. Simple, right? You might be unpleasantly surprised. The Challenge The challenge is simple: building a button with an expanding border on hover. This article will focus on genuine CSS tricks that would be easy to drop into any project without having to touch the\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/12\/border-feature.png?fit=1200%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/12\/border-feature.png?fit=1200%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/12\/border-feature.png?fit=1200%2C750&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/12\/border-feature.png?fit=1200%2C750&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/12\/border-feature.png?fit=1200%2C750&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":279313,"url":"https:\/\/css-tricks.com\/keep-math-in-the-css\/","url_meta":{"origin":395946,"position":2},"title":"Keep Math in the CSS","author":"Chris Coyier","date":"December 12, 2018","format":false,"excerpt":"There is a sentiment that leaving math calculations in your CSS is a good idea that I agree with. This is for math that you could calculate at authoring time, but specifically chose not to. For instance, if you needed a 7-column float-based grid (don't ask), it's cleaner and more\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/06\/brain-gears.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/06\/brain-gears.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/06\/brain-gears.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/06\/brain-gears.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/06\/brain-gears.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":279328,"url":"https:\/\/css-tricks.com\/slice-and-dice-a-disc-with-css\/","url_meta":{"origin":395946,"position":3},"title":"Slice and Dice a Disc with CSS","author":"Ana Tudor","date":"January 13, 2019","format":false,"excerpt":"I recently came across an interesting sliced disc design. The disc had a diagonal gradient and was split into horizontal slices, offset a bit from left to right. Naturally, I started to think what would the most efficient way of doing it with CSS be. Sliced gradient disc. The first\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/sliced_disc.png?fit=1000%2C580&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/sliced_disc.png?fit=1000%2C580&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/sliced_disc.png?fit=1000%2C580&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/sliced_disc.png?fit=1000%2C580&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":238093,"url":"https:\/\/css-tricks.com\/using-calc-to-fake-a-media-query\/","url_meta":{"origin":395946,"position":4},"title":"Using calc() to fake a media query","author":"Chris Coyier","date":"February 17, 2016","format":false,"excerpt":"A bonafide CSS trick by R\u00e9mi Parmentier. It's used in the context of emails here, but it's a clever trick in it's own right. This is the trick: \/* When parent is 500px wide... *\/ .block { min-width: 50%; \/* 250px WINNER *\/ max-width: 100%; \/* 500px *\/ width: calc(480px\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":278695,"url":"https:\/\/css-tricks.com\/dry-state-switching-with-css-variables-fallbacks-and-invalid-values\/","url_meta":{"origin":395946,"position":5},"title":"DRY State Switching With CSS Variables: Fallbacks and Invalid Values","author":"Ana Tudor","date":"December 6, 2018","format":false,"excerpt":"This is the second post in a two-part series that looks into the way CSS variables can be used to make the code for complex layouts and interactions less difficult to write and a lot easier to maintain. The first installment walks through various use cases where this technique applies.\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/clothesline-missing-garment.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/clothesline-missing-garment.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/clothesline-missing-garment.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/clothesline-missing-garment.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/clothesline-missing-garment.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395946"}],"version-history":[{"count":2,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395946\/revisions"}],"predecessor-version":[{"id":395948,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395946\/revisions\/395948"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395943,"date":"2026-07-03T09:16:38","date_gmt":"2026-07-03T15:16:38","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395943"},"modified":"2026-07-03T09:16:41","modified_gmt":"2026-07-03T15:16:41","slug":"quick-hit-157","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-157\/","title":{"rendered":"Quick Hit #157"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.chrome.com\/release_notes\/150\" rel=\"noopener\">Chrome 150<\/a> becomes the first to ship animatable <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/z\/zoom\/\"><code>zoom<\/code><\/a>, <code>flex-wrap: balance<\/code>, <code>overscroll-behavior: chain<\/code> (chaining with no overscroll), <a href=\"https:\/\/chromestatus.com\/feature\/5153932394102784\" rel=\"noopener\"><code>named-feature()<\/code><\/a>, corner rounding for <a href=\"https:\/\/drafts.csswg.org\/css-shapes-1\/#funcdef-basic-shape-polygon\" rel=\"noopener\"><code>polygon()<\/code><\/a>, and finally, the <a href=\"https:\/\/developer.chrome.com\/blog\/focusgroup-rfc\" rel=\"noopener\"><code>focusgroup<\/code><\/a> attribute.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chrome 150 becomes the first to ship animatable zoom, flex-wrap: balance, overscroll-behavior: chain (chaining with no overscroll), named-feature(), corner rounding [&hellip;]<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[1021,478],"class_list":["post-395943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-chrome","tag-css"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":264012,"url":"https:\/\/css-tricks.com\/new-chrome-63\/","url_meta":{"origin":395943,"position":0},"title":"New in Chrome 63","author":"Geoff Graham","date":"December 19, 2017","format":false,"excerpt":"Yeah, we see browser updates all the time these days and you may have already caught this one. Aside from slick new JavaScript features, there is one new CSS update in Chrome 63 that is easy to overlook but worth calling out: Chrome 63 now supports the CSS overscroll-behavior property,\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":392343,"url":"https:\/\/css-tricks.com\/quick-hit-99\/","url_meta":{"origin":395943,"position":1},"title":"Quick Hit #99","author":"Daniel Schwarz","date":"February 16, 2026","format":false,"excerpt":"Chrome 145 enables % units for letter-spacing and word-spacing as well as overscroll-behavior for all scroll containers, now baseline.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":390613,"url":"https:\/\/css-tricks.com\/prevent-a-page-from-scrolling-while-a-dialog-is-open\/","url_meta":{"origin":395943,"position":2},"title":"Prevent a page from scrolling while a dialog is open","author":"Geoff Graham","date":"December 1, 2025","format":false,"excerpt":"Bramus: Chrome 144 features a small change to\u00a0overscroll-behavior: it now also works on non-scrollable scroll containers. While this change might seem trivial, it fixes an issue developers have been dealing with for ages: prevent a page from scrolling while a\u00a0(modal)\u00a0<dialog>\u00a0is open. YES! Way back in 2019, I worked on \"Prevent\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/10\/dialog-pop.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/10\/dialog-pop.jpg?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/10\/dialog-pop.jpg?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/10\/dialog-pop.jpg?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/10\/dialog-pop.jpg?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":373367,"url":"https:\/\/css-tricks.com\/webkit-features-in-safari-16-0\/","url_meta":{"origin":395943,"position":3},"title":"WebKit Features in Safari 16.0","author":"Geoff Graham","date":"September 13, 2022","format":false,"excerpt":"Whew boy, Safari 16 is officially out in the wild and it packs in a bunch of features, some new and exciting (Subgrid! Container Queries! Font Palettes!) and others we've been waiting on for better cross-browser support (Motion Path! Overscroll Behavior! AVIF!). I imagine Jen Simmons typing cheerfully writing out\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":392088,"url":"https:\/\/css-tricks.com\/quick-hit-94\/","url_meta":{"origin":395943,"position":4},"title":"Quick Hit #94","author":"Daniel Schwarz","date":"February 4, 2026","format":false,"excerpt":"A quick warning about overscroll-behavior: contain.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":392302,"url":"https:\/\/css-tricks.com\/whats-important-5\/","url_meta":{"origin":395943,"position":5},"title":"What\u2019s !important #5: Lazy-loading iframes, Repeating corner-shape Backgrounds, and More","author":"Daniel Schwarz","date":"February 13, 2026","format":false,"excerpt":"This issue of What\u2019s !important is dedicated to our friends in the UK, who are currently experiencing a very miserable 43-day rain streak. Presenting: the five most interesting things to read about CSS from the last couple of weeks. Plus, the latest features from Chrome 145, and anything else you\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/wi5.jpg?fit=1200%2C612&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/wi5.jpg?fit=1200%2C612&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/wi5.jpg?fit=1200%2C612&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/wi5.jpg?fit=1200%2C612&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/02\/wi5.jpg?fit=1200%2C612&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395943"}],"version-history":[{"count":2,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395943\/revisions"}],"predecessor-version":[{"id":395945,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395943\/revisions\/395945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395937,"date":"2026-07-02T08:27:19","date_gmt":"2026-07-02T14:27:19","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395937"},"modified":"2026-07-02T08:27:22","modified_gmt":"2026-07-02T14:27:22","slug":"quick-hit-156","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-156\/","title":{"rendered":"Quick Hit #156"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.chrome.com\/release_notes\/150\" rel=\"noopener\">Chrome 150<\/a> implements comma-separated <a href=\"https:\/\/css-tricks.com\/css-container-queries\/\">container queries<\/a> as well as <code>&lt;image><\/code> support for <a href=\"https:\/\/css-tricks.com\/almanac\/functions\/l\/light-dark\/\"><code>light-dark()<\/code><\/a>, following Firefox support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chrome 150 implements comma-separated container queries as well as &lt;image> support for light-dark(), following Firefox support.<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[1021,510,478,19130],"class_list":["post-395937","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-chrome","tag-container-queries","tag-css","tag-light-dark-2"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":394647,"url":"https:\/\/css-tricks.com\/quick-hit-131\/","url_meta":{"origin":395937,"position":0},"title":"Quick Hit #131","author":"Daniel Schwarz","date":"May 6, 2026","format":false,"excerpt":"Following Safari and Firefox, Chrome 148 updates the container query syntax to allow for name-only container queries.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":390626,"url":"https:\/\/css-tricks.com\/quick-hit-64\/","url_meta":{"origin":395937,"position":1},"title":"Quick Hit #64","author":"Daniel Schwarz","date":"December 3, 2025","format":false,"excerpt":"Chrome 143 has introduced anchored fallback container queries to help us query the currently applied fallback position of anchored elements.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":360320,"url":"https:\/\/css-tricks.com\/a-new-container-query-polyfill-that-just-works\/","url_meta":{"origin":395937,"position":2},"title":"A New Container Query Polyfill That Just Works","author":"Chris Coyier","date":"January 6, 2022","format":false,"excerpt":"There is an easy-to-use CSS container query polyfill now. You essentially conditionally load it and forget about it. Then write spec-compliant container queries code.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-01-at-7.02.53-AM.png?fit=759%2C480&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-01-at-7.02.53-AM.png?fit=759%2C480&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-01-at-7.02.53-AM.png?fit=759%2C480&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-01-at-7.02.53-AM.png?fit=759%2C480&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":373367,"url":"https:\/\/css-tricks.com\/webkit-features-in-safari-16-0\/","url_meta":{"origin":395937,"position":3},"title":"WebKit Features in Safari 16.0","author":"Geoff Graham","date":"September 13, 2022","format":false,"excerpt":"Whew boy, Safari 16 is officially out in the wild and it packs in a bunch of features, some new and exciting (Subgrid! Container Queries! Font Palettes!) and others we've been waiting on for better cross-browser support (Motion Path! Overscroll Behavior! AVIF!). I imagine Jen Simmons typing cheerfully writing out\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/09\/New-WebKit-Features-in-Safari-16.0.001.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":338521,"url":"https:\/\/css-tricks.com\/say-hello-to-css-container-queries\/","url_meta":{"origin":395937,"position":4},"title":"Say Hello to CSS Container Queries","author":"Robin Rendle","date":"April 20, 2021","format":false,"excerpt":"Container queries are finally here! Now available behind a flag in the latest version of Chrome Canary, you can go ahead and experiment to your heart\u2019s content. Oh, and if you\u2019re not familiar with container queries then check out this post by Ethan Marcotte about why they're so dang important.\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/container-queries.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/container-queries.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/container-queries.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/container-queries.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/container-queries.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":352459,"url":"https:\/\/css-tricks.com\/css-is-going-gosh-darned-hog-wild-i-tell-ya-what\/","url_meta":{"origin":395937,"position":5},"title":"CSS is Going Gosh-Darned Hog Wild, I Tell Ya What","author":"Chris Coyier","date":"October 13, 2021","format":false,"excerpt":"As someone just sittin' back watching CSS evolve, it feels like we're at one of the hottest moments of innovation in CSS history. It was really something when we got flexbox across all browsers, and not terribly long after, grid. They changed the game from CSS feeling like an awkward\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/css-tricks-logo-blur.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/css-tricks-logo-blur.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/css-tricks-logo-blur.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/css-tricks-logo-blur.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/css-tricks-logo-blur.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395937"}],"version-history":[{"count":1,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395937\/revisions"}],"predecessor-version":[{"id":395938,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395937\/revisions\/395938"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395933,"date":"2026-07-01T08:34:27","date_gmt":"2026-07-01T14:34:27","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395933"},"modified":"2026-07-01T08:35:02","modified_gmt":"2026-07-01T14:35:02","slug":"quick-hit-155","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-155\/","title":{"rendered":"Quick Hit #155"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.chrome.com\/release_notes\/150\" rel=\"noopener\">Chrome 150<\/a> ships <a href=\"https:\/\/webkit.org\/blog\/16214\/background-clip-border-area\/\" rel=\"noopener\"><code>background-clip: border-area<\/code><\/a> (supported by Safari already).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chrome 150 ships background-clip: border-area (supported by Safari already).<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[574,1021,478],"class_list":["post-395933","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-background-clip","tag-chrome","tag-css"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":7423,"url":"https:\/\/css-tricks.com\/transparent-borders-with-background-clip\/","url_meta":{"origin":395933,"position":0},"title":"Transparent Borders with\u00a0background-clip","author":"Chris Coyier","date":"September 17, 2010","format":false,"excerpt":"Have you ever seen an element on a page with transparent borders? I think Facebook originally popularized it giving birth to lightbox plugins like Facebox. I don't think Facebook sports the look anymore, but it's still rather neat. You might think it would be as simple as this: #lightbox {\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2010\/09\/background-clip.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2010\/09\/background-clip.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2010\/09\/background-clip.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":393021,"url":"https:\/\/css-tricks.com\/whats-important-7\/","url_meta":{"origin":395933,"position":1},"title":"What\u2019s !important #7: random(), Folded Corners, Anchored Container Queries, and More","author":"Daniel Schwarz","date":"March 16, 2026","format":false,"excerpt":"For this issue we have random(), folded clip-path corners, anchored container queries, customizable select, scroll-triggered animations, and more.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/03\/wi7.png?fit=1200%2C820&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/03\/wi7.png?fit=1200%2C820&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/03\/wi7.png?fit=1200%2C820&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/03\/wi7.png?fit=1200%2C820&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/03\/wi7.png?fit=1200%2C820&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":393515,"url":"https:\/\/css-tricks.com\/whats-important-9\/","url_meta":{"origin":395933,"position":2},"title":"What\u2019s !important #9: clip-path Jigsaws, View Transitions Toolkit, Name-only Containers, and More","author":"Daniel Schwarz","date":"April 17, 2026","format":false,"excerpt":"This issue of What\u2019s !important brings you clip-path jigsaws, a view transitions toolkit, name-only containers, the usual roundup of new, notable web platform features, and more.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/04\/wh9.jpg?fit=1200%2C828&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/04\/wh9.jpg?fit=1200%2C828&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/04\/wh9.jpg?fit=1200%2C828&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/04\/wh9.jpg?fit=1200%2C828&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/04\/wh9.jpg?fit=1200%2C828&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":393608,"url":"https:\/\/css-tricks.com\/quick-hit-125\/","url_meta":{"origin":395933,"position":3},"title":"Quick Hit #125","author":"Daniel Schwarz","date":"April 22, 2026","format":false,"excerpt":"Firefox 150 ships revert-rule, which rolls the rule back to when it didn\u2019t have its current value. It\u2019ll be Baseline once Chrome 148 ships.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":393672,"url":"https:\/\/css-tricks.com\/quick-hit-126\/","url_meta":{"origin":395933,"position":4},"title":"Quick Hit #126","author":"Daniel Schwarz","date":"April 23, 2026","format":false,"excerpt":"Firefox 150 ships :muted and all other media-based pseudo-classes, but they lack support in Chrome.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":392744,"url":"https:\/\/css-tricks.com\/quick-hit-105\/","url_meta":{"origin":395933,"position":5},"title":"Quick Hit #105","author":"Daniel Schwarz","date":"March 4, 2026","format":false,"excerpt":"Safari TP 238 trials customizable <select>, which Chrome has fully implemented already.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395933"}],"version-history":[{"count":1,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395933\/revisions"}],"predecessor-version":[{"id":395934,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395933\/revisions\/395934"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395929,"date":"2026-06-30T08:48:17","date_gmt":"2026-06-30T14:48:17","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395929"},"modified":"2026-06-30T08:48:19","modified_gmt":"2026-06-30T14:48:19","slug":"quick-hit-154","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-154\/","title":{"rendered":"Quick Hit #154"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developer.chrome.com\/release_notes\/150\" rel=\"noopener\">Chrome 150<\/a> implements the <code>AccentColor<\/code>\/<code>AccentColorText<\/code> system-color keywords, making them Baseline.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chrome 150 implements the AccentColor\/AccentColorText system-color keywords, making them Baseline.<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[1021,19106,478],"class_list":["post-395929","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-chrome","tag-colors","tag-css"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":395872,"url":"https:\/\/css-tricks.com\/quick-hit-152\/","url_meta":{"origin":395929,"position":0},"title":"Quick Hit #152","author":"Daniel Schwarz","date":"June 23, 2026","format":false,"excerpt":"Chrome 150 (Beta) and Firefox 154 (Nightly) trial the alpha() relative color CSS function.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":393406,"url":"https:\/\/css-tricks.com\/quick-hit-120\/","url_meta":{"origin":395929,"position":1},"title":"Quick Hit #120","author":"Daniel Schwarz","date":"April 8, 2026","format":false,"excerpt":"Chrome 147 ships contrast-color() (the Color Level 5 version that only resolves to black or white), making it baseline.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":395476,"url":"https:\/\/css-tricks.com\/quick-hit-143\/","url_meta":{"origin":395929,"position":2},"title":"Quick Hit #143","author":"Daniel Schwarz","date":"June 3, 2026","format":false,"excerpt":"Chrome 149 ships image-rendering: crisp-edges, making it Baseline.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":395242,"url":"https:\/\/css-tricks.com\/quick-hit-140\/","url_meta":{"origin":395929,"position":3},"title":"Quick Hit #140","author":"Daniel Schwarz","date":"May 26, 2026","format":false,"excerpt":"Chrome 151 will finally ship the autocorrect attribute, making it Baseline after 17 years.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":393608,"url":"https:\/\/css-tricks.com\/quick-hit-125\/","url_meta":{"origin":395929,"position":4},"title":"Quick Hit #125","author":"Daniel Schwarz","date":"April 22, 2026","format":false,"excerpt":"Firefox 150 ships revert-rule, which rolls the rule back to when it didn\u2019t have its current value. It\u2019ll be Baseline once Chrome 148 ships.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":395949,"url":"https:\/\/css-tricks.com\/quick-hit-159\/","url_meta":{"origin":395929,"position":5},"title":"Quick Hit #159","author":"Daniel Schwarz","date":"July 7, 2026","format":false,"excerpt":"Firefox 154 (Nightly) will ship text-box, text-box-trim, and text-box-edge, making them Baseline.","rel":"","context":"In &quot;Quick Hits&quot;","block_context":{"text":"Quick Hits","link":"https:\/\/css-tricks.com\/category\/quick-hits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395929"}],"version-history":[{"count":2,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395929\/revisions"}],"predecessor-version":[{"id":395931,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395929\/revisions\/395931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395894,"date":"2026-06-30T07:54:14","date_gmt":"2026-06-30T13:54:14","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395894"},"modified":"2026-06-30T08:02:18","modified_gmt":"2026-06-30T14:02:18","slug":"whats-important-14","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/whats-important-14\/","title":{"rendered":"What\u2019s !important #14: Gap Decorations, random(), &lt;select> field sizing, and More"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I know you\u2019re busy, so for <strong>What\u2019s !important #14<\/strong>, I\u2019ll be sprinting through what\u2019s been a stacked couple of weeks despite few browser updates. From CSS Quake to CSS Gap Decorations, this isn\u2019t one to miss!<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 id=\"hyperblam-make-music-with-html\" class=\"wp-block-heading\">Hyperblam: Make music with HTML<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Heydon Pickering created <a href=\"https:\/\/hyperblam.how\/\" rel=\"noopener\">Hyperblam<\/a>, a HTML-driven implementation of the Web Audio API that uses Web Components to create music without JavaScript.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"642\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/1-1.png?resize=1024%2C642&#038;ssl=1\" alt=\"A website screenshot for Hyperblam featuring a black background with a stylized white logo above navigation links, large hand-drawn text reading WRITE MUSIC NOT JAVASCRIPT, followed by a brief introductory sentence explaining that Hyperblam lets users make music with HTML.\" class=\"wp-image-395896\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/1-1-scaled.png?resize=1024%2C642&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/1-1-scaled.png?resize=300%2C188&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/1-1-scaled.png?resize=768%2C482&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/1-1-scaled.png?resize=1536%2C963&amp;ssl=1 1536w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/1-1-scaled.png?resize=2048%2C1285&amp;ssl=1 2048w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, not very CSS-y, but still pretty cool!<\/p>\n\n\n\n<h2 id=\"css-quake\" class=\"wp-block-heading\">CSS Quake<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Powered by <a href=\"https:\/\/polycss.com\/\" rel=\"noopener\">PolyCSS<\/a>, Layoutit created <a href=\"https:\/\/cssquake.com\/\" rel=\"noopener\">CSS Quake<\/a>, a port of the groundbreaking 1996 game, Quake.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"642\" src=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/2.png?resize=1024%2C642&#038;ssl=1\" alt=\"A screenshot of the first playable moment of Quake.\" class=\"wp-image-395897\" srcset=\"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/2-scaled.png?resize=1024%2C642&amp;ssl=1 1024w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/2-scaled.png?resize=300%2C188&amp;ssl=1 300w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/2-scaled.png?resize=768%2C482&amp;ssl=1 768w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/2-scaled.png?resize=1536%2C963&amp;ssl=1 1536w, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/2-scaled.png?resize=2048%2C1284&amp;ssl=1 2048w\" sizes=\"auto, (min-width: 735px) 864px, 96vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Very<\/em> CSS-y, and a perfect companion to <a href=\"https:\/\/css-tricks.com\/whats-important-7\/#doom-in-css\">CSS DOOM<\/a>, which also shipped recently.<\/p>\n\n\n\n<h2 id=\"a-headfirst-dive-into-css-gap-decorations\" class=\"wp-block-heading\">A head-first dive into CSS Gap Decorations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/css-tricks.com\/author\/afiftemani\/\">Temani Afif<\/a> showed us <a href=\"https:\/\/master.dev\/blog\/lets-play-with-gap-decorations\/\" rel=\"noopener\">how to style gap decorations<\/a>. As you might\u2019ve guessed, \u2018gaps\u2019 are the spaces that <code>gap<\/code>s take up when using flexbox, grid layout, or multi-column layout. To be honest, gap decorations have been a long time coming, but as Temani demonstrated, there\u2019s actually a lot that we can do with them.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_xbggQgj\/f8fd92ac42f4d00a63df914c70439a39\" src=\"\/\/codepen.io\/anon\/embed\/xbggQgj\/f8fd92ac42f4d00a63df914c70439a39?height=450&amp;theme-id=1&amp;slug-hash=xbggQgj\/f8fd92ac42f4d00a63df914c70439a39&amp;default-tab=css,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed xbggQgj\/f8fd92ac42f4d00a63df914c70439a39\" title=\"CodePen Embed xbggQgj\/f8fd92ac42f4d00a63df914c70439a39\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 id=\"css-random-experiments\" class=\"wp-block-heading\">CSS <code>random()<\/code> experiments<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Polypane demonstrated their <a href=\"https:\/\/polypane.app\/blog\/experimenting-with-random-in-css\/\" rel=\"noopener\">CSS <code>random()<\/code> experiments<\/a>. If you\u2019ve been wondering about this elusive CSS function, which still isn\u2019t supported by any browser but Safari, Polypane has created a bokeh effect, some falling petals, an untidy stack of polaroids, a poem, an animated aurora, and more. It\u2019s a pretty deep dive that seemingly shows us everything that we can do with <code>random()<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"974\" style=\"aspect-ratio: 2314 \/ 974;\" width=\"2314\" controls src=\"https:\/\/css-tricks.com\/wp-content\/uploads\/2026\/06\/3.mp4\"><\/video><figcaption class=\"wp-element-caption\">Source: <a href=\"https:\/\/polypane.app\/blog\/experimenting-with-random-in-css\/\" rel=\"noopener\">Polypane<\/a>.<\/figcaption><\/figure>\n\n\n\n<h2 id=\"how-to-make-ltselectgts-fluid\" class=\"wp-block-heading\">How to make <code>&lt;select&gt;<\/code>s fluid<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Manuel Matuzovi\u0107 showed us <a href=\"https:\/\/matuzo.at\/blog\/2026\/select-fieldsize\" rel=\"noopener\">how to set the width of <code>&lt;select&gt;<\/code>s to the width of their selected <code>&lt;option&gt;<\/code> with <code>field-sizing<\/code><\/a> (<code>field-sizing: content<\/code>, to be more specific), which became Baseline when Firefox 152 shipped it a fortnight ago.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another thing to note is that if we use the <code>size<\/code> attribute (e.g., <code>&lt;select size=\"3\"&gt;<\/code>), which turns the <code>&lt;select&gt;<\/code> into a scrollable list box showing three <code>&lt;option&gt;<\/code>s by default, <code>field-sizing: content<\/code> overrides that to show all <code>&lt;option&gt;<\/code>s.<\/p>\n\n\n\n<h2 id=\"the-new-standard-for-css-theming\" class=\"wp-block-heading\">The new standard for CSS theming<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Una Kravets explained <a href=\"https:\/\/una.im\/modern-css-theming\" rel=\"noopener\">how modern CSS theming works<\/a>. We\u2019ve seen a whole lot of this lately, but Una talks about <code><a href=\"https:\/\/css-tricks.com\/almanac\/rules\/p\/property\/\">@property<\/a><\/code>, <code><a href=\"https:\/\/css-tricks.com\/almanac\/functions\/l\/light-dark\/\">light-dark()<\/a><\/code>, <code><a href=\"https:\/\/css-tricks.com\/almanac\/functions\/c\/contrast-color\/\">contrast-color()<\/a><\/code>, <em>and<\/em> <code>@container style()<\/code>, all of which are also Baseline as of recently, so this is a great opportunity to see how all of these features work together.<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_MYJeKdb\" src=\"\/\/codepen.io\/anon\/embed\/MYJeKdb?height=450&amp;theme-id=1&amp;slug-hash=MYJeKdb&amp;default-tab=css,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed MYJeKdb\" title=\"CodePen Embed MYJeKdb\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Speaking of which, <a href=\"https:\/\/css-tricks.com\/exploring-the-css-contrast-color-function-a-second-time\/\">I wrote up a thing about <code>contrast-color()<\/code><\/a> after exploring it for the first time.<\/p>\n\n\n\n<h2 id=\"why-websites-dont-need-to-work-the-same-way-for-everybody\" class=\"wp-block-heading\">Why websites don\u2019t need to work the same way for everybody<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Bramus explained <a href=\"https:\/\/www.bram.us\/2026\/06\/21\/do-websites-need-to-function-exactly-the-same-on-every-platform\/\" rel=\"noopener\">why websites don\u2019t need to work the same way for everybody<\/a>. For example, different platforms have different primary input modalities, and even then, users might have a secondary one hooked up that they prefer, which is why we need to abandon the idea of making websites identical across platforms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">He also talks about three incredibly interesting web platform features \u2014 interest invokers, overscroll actions, and the Document Picture-in-Picture API \u2014 that must function differently depending on the platform.<\/p>\n\n\n\n<h2 id=\"marina-aisa-at-web-engines-hackfest\" class=\"wp-block-heading\">Marina A\u00edsa at Web Engines Hackfest<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While everybody was still talking about CSS Day (<a href=\"https:\/\/css-tricks.com\/whats-important-13\/#what-happened-at-css-day-2026\">including me<\/a>), <a href=\"https:\/\/webengineshackfest.org\/\" rel=\"noopener\">Web Engines Hackfest<\/a> was kicking off in A Coru\u00f1a, Galicia. What I love about these events (besides the talks, of course) is attendees talking about the talks, the people that they met, what else they did while they was in town, and so on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s <a href=\"https:\/\/bsky.app\/profile\/marinaaisa.com\/post\/3moifdog32k23\" rel=\"noopener\">Marina A\u00edsa documenting the two-day event<\/a>, starting off with a hike in a Galician forest, then two days of talks about web engines and web standards (interspersed with some wall climbing), then finally some discussion about what browsers can do to help improve web accessibility:<\/p>\n\n\n\n<blockquote class=\"bluesky-embed\" data-bluesky-uri=\"at:\/\/did:plc:tpem4cjgzwlpu5cvevvcsfwn\/app.bsky.feed.post\/3mofvqz72g22m\" data-bluesky-cid=\"bafyreibt25wi4idfxr5fruxvla4tll4wybmhz2fjtkpivev2viijhybl64\" data-bluesky-embed-color-mode=\"system\"><p lang=\"en\">This week I&#x27;m in A Coru\u00f1a, Galicia, attending the @webengineshackfest.org &#x1f469;&#x200d;&#x1f4bb; where we are discussing the future of web engines and standards.\n\nGiven the potential impact on future web development, I thought it would be helpful to share some of my personal notes from the event. &#x270d;&#xfe0f;&#x1f447;<\/p>&mdash; Marina A\u00edsa (<a href=\"https:\/\/bsky.app\/profile\/did:plc:tpem4cjgzwlpu5cvevvcsfwn?ref_src=embed\" rel=\"noopener\">@marinaaisa.com<\/a>) <a href=\"https:\/\/bsky.app\/profile\/did:plc:tpem4cjgzwlpu5cvevvcsfwn\/post\/3mofvqz72g22m?ref_src=embed\" rel=\"noopener\">14:31 \u00b7 Jun 16, 2026<\/a><\/blockquote><script async src=\"https:\/\/embed.bsky.app\/static\/embed.js\" charset=\"utf-8\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\">Personal goal for next year: to attend one of these events!<\/p>\n\n\n\n<h2 id=\"new-web-platform-features\" class=\"wp-block-heading\">New web platform feature<del>s<\/del><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Firefox\/Releases\/152\" rel=\"noopener\">Firefox 152<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/css-tricks.com\/almanac\/properties\/f\/field-sizing\/\"><code>field-sizing<\/code><\/a> (now Baseline)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, it\u2019s been a dull couple of weeks for stable browsers, but there are some really exciting things coming up. Keep your eyes on our <a href=\"https:\/\/css-tricks.com\/category\/quick-hits\/\">Quick Hits<\/a>, because that\u2019s where I share these web platform updates first (plus those from developmental browsers). In fact, Chrome 150 will be shipping later today.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See ya\u2019ll in two weeks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I know you\u2019re busy, so for What\u2019s !important #14, I\u2019ll be sprinting through what\u2019s been a stacked couple of weeks despite few browser updates. From CSS Quake to CSS Gap Decorations, this isn\u2019t one to miss!<\/p>\n","protected":false},"author":288677,"featured_media":395895,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[19081],"class_list":["post-395894","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-news"],"acf":{"show_toc":"Yes"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/06\/wi14.jpg?fit=1516%2C1258&ssl=1","jetpack-related-posts":[{"id":391134,"url":"https:\/\/css-tricks.com\/whats-important-1\/","url_meta":{"origin":395894,"position":0},"title":"What\u2019s !important #1: Advent Calendars, CSS Wrapped, Web Platform Updates, and More","author":"Daniel Schwarz","date":"December 16, 2025","format":false,"excerpt":"The best CSS news from around the web from the last two weeks. In this edition: advent calendars, CSS Wrapped 2025, and the latest Web Platform Updates.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/css-wrapped.png?fit=1200%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/css-wrapped.png?fit=1200%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/css-wrapped.png?fit=1200%2C750&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/css-wrapped.png?fit=1200%2C750&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/css-wrapped.png?fit=1200%2C750&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":387471,"url":"https:\/\/css-tricks.com\/the-gap-strikes-back-now-stylable\/","url_meta":{"origin":395894,"position":1},"title":"The Gap Strikes Back: Now Stylable","author":"Patrick Brosset","date":"July 1, 2025","format":false,"excerpt":"Styling the space between layout items \u2014 the gap \u2014 has typically required some clever workarounds. But a new CSS feature changes all that with just a few simple CSS properties that make it easy, yet also flexible, to display styled separators between your layout items.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"A two-by-three grid of light gray boxes with spacing between. Behind them is a backdrop with the word gap repeated nine times.","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/gap.png?fit=1200%2C631&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/gap.png?fit=1200%2C631&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/gap.png?fit=1200%2C631&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/gap.png?fit=1200%2C631&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/gap.png?fit=1200%2C631&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":391542,"url":"https:\/\/css-tricks.com\/whats-important-3\/","url_meta":{"origin":395894,"position":2},"title":"What\u2019s !important #3: Popover Context Menus, @scope, New Web Platform Features, and More","author":"Daniel Schwarz","date":"January 15, 2026","format":false,"excerpt":"The developer community hasn\u2019t wasted any time kicking off 2026 with some really great articles, demos, and insights. Firefox 147 and Chrome 144 also shipped, and while they\u2019re not jam-packed with features, the releases are still pretty exciting for what\u2019s normally a slow time of year, so without further ado,\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"A screenshot showing a web browser displaying an article about Ursula K. Le Guin's writing routine. At the bottom of the browser window, a tooltip reveals a custom URL protocol: Open ia-writer:\/\/open?path=notes:2026-01-04T2023.md in a new tab. A red arrow points from text in a markdown editor in the background to this tooltip, illustrating how clicking a web link can open a specific file in the iA Writer application using the custom protocol handler.","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi3.png?fit=1200%2C853&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi3.png?fit=1200%2C853&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi3.png?fit=1200%2C853&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi3.png?fit=1200%2C853&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi3.png?fit=1200%2C853&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":392661,"url":"https:\/\/css-tricks.com\/whats-important-6\/","url_meta":{"origin":395894,"position":3},"title":"What\u2019s !important #6: :heading, border-shape, Truncating Text From the Middle, and More","author":"Daniel Schwarz","date":"February 27, 2026","format":false,"excerpt":"Despite what\u2019s been a sleepy couple of weeks for new Web Platform Features, we have an issue of What\u2019s !important that\u2019s prrrretty jam-packed. The web community had a lot to say, it seems, so fasten your seatbelts!","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/12\/important-color.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/12\/important-color.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/12\/important-color.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/12\/important-color.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/12\/important-color.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":391967,"url":"https:\/\/css-tricks.com\/whats-important-4\/","url_meta":{"origin":395894,"position":4},"title":"What\u2019s !important #4: Videos &amp; View Transitions, Named Media Queries, How Browsers Work, and More","author":"Daniel Schwarz","date":"January 30, 2026","format":false,"excerpt":"Neither Chrome, Safari, nor Firefox have shipped new features in the last couple of weeks, but fear not because leading this issue of What\u2019s !important is some of the web development industry\u2019s best educators with, frankly, some killer content.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi4.png?fit=1200%2C696&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi4.png?fit=1200%2C696&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi4.png?fit=1200%2C696&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi4.png?fit=1200%2C696&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/01\/wi4.png?fit=1200%2C696&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":394879,"url":"https:\/\/css-tricks.com\/whats-important-11\/","url_meta":{"origin":395894,"position":5},"title":"What\u2019s !important #11: 3D Voxel Scenes, Flying Focus, CSS Syntaxes, and More","author":"Daniel Schwarz","date":"May 15, 2026","format":false,"excerpt":"If 3D voxel scenes (that you can style), flying focus animations, or new CSS syntaxes sound like your kinda thing, then this issue of What\u2019s !important is definitely for you.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/05\/wh11.jpg?fit=1200%2C996&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/05\/wh11.jpg?fit=1200%2C996&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/05\/wh11.jpg?fit=1200%2C996&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/05\/wh11.jpg?fit=1200%2C996&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2026\/05\/wh11.jpg?fit=1200%2C996&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395894"}],"version-history":[{"count":6,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395894\/revisions"}],"predecessor-version":[{"id":395928,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395894\/revisions\/395928"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/395895"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395223,"date":"2026-06-29T07:03:32","date_gmt":"2026-06-29T13:03:32","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395223"},"modified":"2026-06-30T19:44:13","modified_gmt":"2026-07-01T01:44:13","slug":"css-states-and-javascript-events","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/css-states-and-javascript-events\/","title":{"rendered":"The Shifting Line Between CSS States and JavaScript Events"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">CSS is listening to us. <a href=\"https:\/\/www.snopes.com\/fact-check\/is-amazons-alexa-emitting-unprompted-creepy-laughing\/\" rel=\"noopener\">No, not like <em>that<\/em><\/a>. Rather, CSS is accumulating more and more pseudo-classes to help us respond to JavaScript events so that we don\u2019t have to do so with JavaScript itself. But while pseudo-classes track states, not events, they sure can feel like event listeners sometimes (not that it really matters in the context of CSS).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then again, what <em>is<\/em> CSS these days? For example, there\u2019s a <a href=\"https:\/\/drafts.csswg.org\/animation-triggers-1\/\/#event-triggers\" rel=\"noopener\">proposal for <code>event-trigger<\/code><\/a> in the Animation Triggers spec, which would basically listen for events and trigger animations. If you ask me though, the syntax is capable of a lot more than that (think: <a href=\"https:\/\/css-tricks.com\/invoker-commands-additional-ways-to-work-with-dialog-popover-and-more\/\">invoker commands<\/a> but for CSS).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But to stay in today\u2019s reality, I\u2019ll walk you through the different CSS pseudo-classes out there that are kind of like event listeners, before doing the same for <code>event-trigger<\/code>, where I\u2019ll show you how (I think) this currently unsupported feature would work.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"-event-listening-pseudo-classes\">\u201cEvent listening\u201d pseudo-classes<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-hover-and-active-\"><code>:hover<\/code> and <code>:active<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/h\/hover\/\"><code>:hover<\/code><\/a> state captures the moment from when the <code>pointerenter<\/code> event fires to when the <code>pointerleave<\/code> event fires, which perfectly illustrates why pseudo-classes are states, not events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/a\/active\/\"><code>:active<\/code><\/a> matches the target (e.g., a link or button) that\u2019s currently being pressed with a mouse, finger, or stylus, which makes it akin to <code>pointerdown<\/code> and <code>pointerup<\/code>\/<code>pointercancel<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By the way, the <a href=\"https:\/\/css-tricks.com\/almanac\/properties\/p\/pointer-events\/\"><code>pointer-events: none<\/code><\/a> CSS declaration prevents pointer events from firing on the selected element!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-focus-and-focus-visible-\"><code>:focus<\/code> and <code>:focus-visible<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/f\/focus\/\"><code>:focus<\/code><\/a> pseudo-class is akin to the <code>focus<\/code> and <code>blur<\/code> (unfocus) JavaScript events, but <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/f\/focus-visible\/\"><code>:focus-visible<\/code><\/a> is a bit more complex. <code>:focus-visible<\/code> triggers when <code>:focus<\/code> does, but in addition, the browser uses a variety of heuristics to determine whether or not a focus indicator should be shown. Is the user operating with a keyboard? Is the element a form control? This really makes me appreciate what CSS offers. In fact, the best way to handle this using JavaScript is to query the CSS pseudo-class:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">element.addEventListener(\"focus\", (event) => {\n  if (event.target.matches(\":focus-visible\")) {\n    \/* Do something *\/\n  }\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-focus-within-and-has-\"><code>:focus-within<\/code> (and <code>:has()<\/code>)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript excels at the \u201cif A is Y, then do Z to B\u201d kind of stuff. We can traverse the DOM, leverage event propagation, and much more. In that regard, CSS can feel a bit limited. However, CSS is evolving quickly. It has many new if-this-do-that features such as <a href=\"https:\/\/css-tricks.com\/unleash-the-power-of-scroll-driven-animations\/\">scroll-driven animations<\/a>, and it\u2019ll have more in the future. HTML is doing the same with dedicated components such as <a href=\"https:\/\/css-tricks.com\/more-details-on-details\/\"><code>&lt;details><\/code><\/a>, which all have accompanying CSS features.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019ll mention some of that later, actually. In a more holistic sense, what we have is <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/f\/focus-within\/\"><code>:focus-within<\/code><\/a>, which matches if a child has focus, and <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/h\/has\/\"><code>:has()<\/code><\/a>, which accepts any valid selector and matches if such a relationship exists between the two selectors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, these two selectors do the exact same thing:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">form:focus-within {\n  \/* Style the form when something within has focus *\/\n}\n\nform:has(:focus) {\n  \/* Style the form when something within has focus *\/\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-checked-\"><code>:checked<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s fairly obvious what <code><a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/c\/checked\/\">:checked<\/a><\/code> does. The JavaScript event that\u2019s most synonymous with it is <code>change<\/code>, which fires when the value of an <code>&lt;input&gt;<\/code>, <code>&lt;select&gt;<\/code>, or <code>&lt;textarea&gt;<\/code> changes (although, in this context, the <code>input<\/code> event is quite similar).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To listen for a check, we\u2019d do something like this:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">checkbox.addEventListener(\"change\", (event) => {\n  if (event.target.checked) {\n    \/* Checked *\/\n  } else {\n    \/* Not checked *\/\n  }\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">CSS pseudo-classes often capture the moment between two JavaScript events (e.g., <code>pointerenter<\/code> and <code>pointerleave<\/code>), but when they\u2019re not doing that, they\u2019re handling logic instead, as above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s look at some more examples of hidden logic handling.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-valid-invalid-user-valid-user-invalid-autofill-\"><code>:valid\/:invalid\/:user-valid\/:user-invalid\/:autofill<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We don\u2019t need the <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/n\/not\/\"><code>:not()<\/code><\/a> pseudo-class function here, as validity can be checked using both the <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/v\/valid\/\"><code>:valid<\/code><\/a> and <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/i\/invalid\/\"><code>:invalid<\/code><\/a> pseudo-classes, but on the JavaScript side of things, there\u2019s no <code>valid<\/code> event (only <code>invalid<\/code>). That being said, if using JavaScript, you\u2019ll likely want to call the <code>checkValidity()<\/code> method (which actually fires the <code>invalid<\/code> event if it returns <code>false<\/code>) within the callback of the event listener for <code>input<\/code>, <code>change<\/code>, <code>blur<\/code> (to check validity when unfocusing from an element), or <code>submit<\/code> (to check validity of the entire form when submitting it, as below).<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">form.addEventListener(\"submit\", () => {\n  if (form.checkValidity()) {\n    \/* All form controls are valid *\/\n  } else {\n    \/* A form control is invalid (the invalid event fires) *\/\n  }\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We can also do this with the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/ValidityState\" rel=\"noopener\"><code>ValidityState<\/code><\/a> object, which doesn\u2019t fire the <code>invalid<\/code> event, but does tell us why a form control is valid or invalid in the same way that HTML form validation does:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">input.addEventListener(\"input\", () => {\n  if (input.validity.valid) {\n    \/* Input is valid *\/\n  } else {\n    \/* Input is invalid (the invalid event doesn\u2019t fire) *\/\n  }\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The thing about HTML form validation is that it takes care of the entire front end, but if there\u2019s a non-default behavior that you need, <code>checkValidity()<\/code> or <code>ValidityState<\/code> is what you\u2019re looking for.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pseudo-classes will work either way. A little too well, in fact! An easy thing to miss is that form controls trigger either <code>:valid<\/code> or <code>:invalid<\/code> immediately. However, <code>:user-valid<\/code> and <code>:user-invalid<\/code> wait for users to supply a value and unfocus before triggering. This is actually what the <code>change<\/code> event does (unless the element is a checkbox, radio button, dropdown list, color picker, or range slider), and what makes it different from the <code>input<\/code> event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There isn\u2019t a JavaScript event for auto-filling or even a clean way to detect it using JavaScript, but there <em>is<\/em> an <code>:autofill<\/code> pseudo-class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"media-element-pseudo-classes\">Media element pseudo-classes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Media element pseudo-classes are still new. They aren\u2019t supported by Chrome yet and only landed in Firefox recently, but they are a part of <a href=\"https:\/\/css-tricks.com\/interop-2026\/\">Interop 2026<\/a> and soon we\u2019ll be able to style <code>&lt;audio><\/code> and <code>&lt;video><\/code> elements based on their state without listening to JavaScript events. I\u2019m sure you understand how this works by now, so here\u2019s a quick rundown:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Pseudo-class<\/th><th>JavaScript event equivalent<\/th><\/tr><\/thead><tbody><tr><td><code>:buffering<\/code><\/td><td><code>waiting<\/code><\/td><\/tr><tr><td><code>:muted<\/code><\/td><td><code>volumechange<\/code> (but see below)<\/td><\/tr><tr><td><code>:paused<\/code><\/td><td><code>pause<\/code><\/td><\/tr><tr><td><code>:playing<\/code><\/td><td><code>playing<\/code> (not <code>play<\/code>)<\/td><\/tr><tr><td><code>:seeking<\/code><\/td><td><code>seeking<\/code><\/td><\/tr><tr><td><code>:stalled<\/code><\/td><td><code>stalled<\/code><\/td><\/tr><tr><td><code>:volume-locked<\/code><\/td><td>N\/A, see below<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Use the <code>volumechange<\/code> event to detect mute:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">audio.addEventListener(\"volumechange\", () => {\n  if (audio.muted) {\n    \/\/ Muted\n  } else {\n    \/\/ Not muted\n  }\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Detecting volume lock means trying to change the volume and checking for success. The best approach is to create an entirely new element so that we don\u2019t trigger <code>volumechange<\/code> on the real one:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">\/\/ Create video\nconst video = document.createElement(\"video\");\n\n\/\/ Change volume\nvideo.volume = 0.5;\n\nif (video.volume !== 0.5) {\n  \/\/ Volume locked\n} else {\n  \/\/ Volume not locked\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">(Or to use the <code>:volume-locked<\/code> pseudo-class, if writing CSS.)<\/p>\n\n\n\n<h3 id=\"popoveropen-open-modal\" class=\"wp-block-heading\"><code>:popover-open \/ :open \/ :modal<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">As we might expect, there\u2019s no JavaScript event for when a popover, <code>&lt;dialog&gt;<\/code>, or <code>&lt;details&gt;<\/code> opens or closes, but we can listen for the <code>toggle<\/code> event and then check the state:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">element.addEventListener(\"toggle\", () => {\n  if (element.open) {\n    \/* Popover\/dialog\/details open *\/\n  } else {\n    \/* Popover\/dialog\/details not open *\/\n  }\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">However, CSS offers these pseudo-classes right out of the box:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/p\/popover-open\/)\">:popover-open<\/a><\/code> (for popovers)<\/li>\n\n\n\n<li><a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/o\/open\/\"><code>:open<\/code><\/a> (for <code>&lt;dialog&gt;<\/code> and <code>&lt;details&gt;<\/code> elements)<\/li>\n\n\n\n<li><code>:modal<\/code> (for modal <code>&lt;dialog&gt;<\/code>s and fullscreen elements)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Speaking of fullscreen elements\u2026<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-fullscreen-\"><code>:fullscreen<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/f\/fullscreen\/\"><code>:fullscreen<\/code><\/a> pseudo-class is synonymous with the <code>fullscreenchange<\/code> JavaScript event with a conditional baked in:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">document.addEventListener(\"fullscreenchange\", () => {\n  if (document.fullscreenElement) {\n    \/* fullscreenElement is fullscreen *\/\n  } else {\n    \/* Nothing is fullscreen (fullscreenElement is null) *\/\n  }\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-target-\"><code>:target<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When a URL hash (e.g., <code>#contact<\/code>) matches an element\u2019s ID (e.g., <code>&lt;div id=\"contact\"&gt;<\/code>), that element matches the <a href=\"https:\/\/css-tricks.com\/almanac\/pseudo-selectors\/t\/target\/\"><code>:target<\/code><\/a> pseudo-class. When using JavaScript, we have to listen for the <code>hashchange<\/code> event and then see if a matching element is found:<\/p>\n\n\n\n<pre rel=\"JavaScript\" class=\"wp-block-csstricks-code-block language-javascript\" data-line=\"\"><code markup=\"tt\">window.addEventListener(\"hashchange\", () => {\n  const target = document.getElementById(window.location.hash.substring(1));\n\n  if (target) {\n    \/* Matching element found *\/\n  } else {\n    \/* Matching element not found *\/\n  }\n});<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion-but-not-really-\">Conclusion (but not really)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This isn\u2019t a \u201cJavaScript bad\u201d rant but rather an appreciation for what CSS simplifies without forgetting the surgical control that JavaScript offers. More ways to do things is never a bad thing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And on that note, I want to quickly mention <code>event-trigger<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"actual-event-listeners-event-trigger-\">Actual event listeners (<code>event-trigger<\/code>)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I came across <a href=\"https:\/\/drafts.csswg.org\/animation-triggers-1\/#event-triggers\" rel=\"noopener\">event triggers<\/a> when Chrome implemented scroll-triggered animations, as they\u2019re in the same module, but they\u2019re not supported by any web browser yet, so if I make any mistakes, I apologize. Let\u2019s dive in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>event-trigger-name<\/code> will accept a simple dashed ident:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">button {\n  event-trigger-name: --event;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>event-trigger-source<\/code> will be the event listener, essentially.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019ll accept the following keywords:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>activate<\/code><\/li>\n\n\n\n<li><code>interest<\/code><\/li>\n\n\n\n<li><code>click<\/code><\/li>\n\n\n\n<li><code>touch<\/code><\/li>\n\n\n\n<li><code>dblclick<\/code><\/li>\n\n\n\n<li><code>keypress(&lt;string&gt;)<\/code><\/li>\n<\/ul>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">button {\n  event-trigger-source: click;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I believe the <code>interest<\/code> keyword refers to the upcoming <a href=\"https:\/\/css-tricks.com\/a-first-look-at-the-interest-invoker-api-for-hover-triggered-popovers\/\">Interest Invoker API<\/a> whereas the <code>activate<\/code> keyword could depend on the element. For <code>&lt;details&gt;<\/code> for example, activation could mean <em>when opened<\/em>, but I\u2019m not sure. Subsequent drafts of the spec should tell us more, and reveal more events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyway, the events will trigger animations. First we\u2019d create a <code>@keyframes<\/code> animation, then we\u2019d attach it to the element to be animated, but the animation wouldn\u2019t run until triggered by the event (whereas normally they\u2019d run immediately).<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">@keyframes fade-in {\n  from { opacity: 0; }\n  to { opacity: 1; }\n}\n\ndiv {\n  animation: fade-in 300ms both;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then we ensure that when the event fires, the animation triggers. We do this by setting <code>animation-trigger<\/code> alongside <code>animation<\/code>, referencing the dashed ident (<code>--event<\/code>). This has the optional benefit of allowing the event of one element to trigger the animation of another. Here\u2019s a quick example, using the <code>event-trigger<\/code> shorthand this time:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">@keyframes fade-in {\n  from { opacity: 0; }\n  to { opacity: 1; }\n}\n\nbutton {    \n  \/* On click, trigger --event animation *\/\n  event-trigger: --event click;\n}\n\ndiv {\n  \/* When --event fires, play animation forwards *\/\n  animation-trigger: --event play-forwards;\n\n  \/* Animation *\/\n  animation: fade-in 300ms both;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is what\u2019s called a state<em>less<\/em> event trigger. Think about it \u2014 you can\u2019t unclick a click, right? But we can lose interest, so here\u2019s what a state<em>full<\/em> event-triggered animation would look like (notice the syntax for <em>two<\/em> events separated by a <code>\/<\/code> and <em>two<\/em> animation actions, one for each state):<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">@keyframes fade-in {\n  from { opacity: 0; }\n  to { opacity: 1; }\n}\n\nbutton {    \n  \/* interest (entry) \/ interest (exit) *\/\n  event-trigger: --event interest \/ interest;\n}\n\ndiv {\n  \/* Play forward with interest, backward when losing it *\/\n  animation-trigger: --event play-forwards play-backwards;\n\n  \/* Animation *\/\n  animation: fade-in 300ms both;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Acceptable animation actions include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>none<\/code><\/li>\n\n\n\n<li><code>play<\/code><\/li>\n\n\n\n<li><code>play-once<\/code><\/li>\n\n\n\n<li><code>play-forwards<\/code><\/li>\n\n\n\n<li><code>play-backwards<\/code><\/li>\n\n\n\n<li><code>pause<\/code><\/li>\n\n\n\n<li><code>reset<\/code><\/li>\n\n\n\n<li><code>replay<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">There are many combinations of events and animation actions that wouldn\u2019t work, but these would be easy to sidestep because it wouldn\u2019t make sense to use them. We could, however, trigger multiple different animations because <code>animation-trigger<\/code> is a reset-only sub-property <code>animation<\/code>. Here\u2019s a rough example:<\/p>\n\n\n\n<pre rel=\"CSS\" class=\"wp-block-csstricks-code-block language-css\" data-line=\"\"><code markup=\"tt\">animation-name: animationA, animationB;\nanimation-trigger: --eventA play, --eventB replay;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The possibilities are endless depending on how the W3C move forward with this feature (the spec mentions allowing for event bubbling!), but I kinda wish we could invoke JavaScript methods with event triggers like how HTML can with the Invoker Commands API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What do you think? A step in the right direction, or does CSS need to stay in its lane?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSS has always had pseudo-classes that style things based on user interactions. Recent features, however, are blurring the line between what CSS &#8220;listens&#8221; for and how they are alternatives to what Javascript typically listens for.<\/p>\n","protected":false},"author":288677,"featured_media":274215,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[1154,1114],"class_list":["post-395223","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-pseudo-elements","tag-state"],"acf":{"show_toc":"Yes"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/07\/state-management.jpg?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":390960,"url":"https:\/\/css-tricks.com\/future-css-drag-and-maybe-dragged-image\/","url_meta":{"origin":395223,"position":0},"title":"Future CSS: :drag (and Maybe ::dragged-image?)","author":"Sunkanmi Fafowora","date":"January 7, 2026","format":false,"excerpt":"Have you ever struggled to style an element while it's being dragged? Sunkanmi explains some ways it could become easier in the future.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"A horizontal menu of buttons in a single row being dragged by a mouse cursor. We can see the menu in its original position and its current dragged position.","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-12-at-10.03.09-AM-scaled-e1765559057362.png?fit=1200%2C357&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-12-at-10.03.09-AM-scaled-e1765559057362.png?fit=1200%2C357&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-12-at-10.03.09-AM-scaled-e1765559057362.png?fit=1200%2C357&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-12-at-10.03.09-AM-scaled-e1765559057362.png?fit=1200%2C357&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-12-at-10.03.09-AM-scaled-e1765559057362.png?fit=1200%2C357&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":339586,"url":"https:\/\/css-tricks.com\/custom-state-pseudo-classes-in-chrome\/","url_meta":{"origin":395223,"position":1},"title":"Custom State Pseudo-Classes in Chrome","author":"\u0160ime Vidas","date":"May 6, 2021","format":false,"excerpt":"There is an increasing number of \u201ccustom\u201d features on the web platform. We have custom properties (--my-property), custom elements (<my-element>), and custom events (new CustomEvent('myEvent')). At one point, we might even get custom media queries (@media (--my-media)). But that\u2019s not all! You might have missed it because it wasn\u2019t mentioned\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/css-custom-pseudo-class-state.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/css-custom-pseudo-class-state.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/css-custom-pseudo-class-state.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/css-custom-pseudo-class-state.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/04\/css-custom-pseudo-class-state.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":194642,"url":"https:\/\/css-tricks.com\/simple-css-row-column-highlighting\/","url_meta":{"origin":395223,"position":2},"title":"Simple CSS-Only Row and Column Highlighting","author":"Chris Coyier","date":"January 30, 2015","format":false,"excerpt":"Highlighting rows of a table is pretty darn easy in CSS. tr:hover { background: yellow; } does well there. But highlighting columns has always been a little trickier, because there is no single HTML element that is parent to table cells in a column. A dash of JavaScript can handle\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":377635,"url":"https:\/\/css-tricks.com\/the-power-of-has-in-css\/","url_meta":{"origin":395223,"position":3},"title":"The Power of :has() in CSS","author":"Chris DeMars","date":"March 29, 2024","format":false,"excerpt":"Hey all you wonderful developers out there! In this post we are going to explore the use of :has() in your next web project. :has() is relatively newish but has gained popularity in the front end community by delivering control over various elements in your UI. Let\u2019s take a look\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":":has CSS selector","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/03\/has-selector.png?fit=1160%2C856&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/03\/has-selector.png?fit=1160%2C856&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/03\/has-selector.png?fit=1160%2C856&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/03\/has-selector.png?fit=1160%2C856&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2024\/03\/has-selector.png?fit=1160%2C856&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":350670,"url":"https:\/\/css-tricks.com\/css-pseudo-commas\/","url_meta":{"origin":395223,"position":4},"title":"CSS Pseudo Commas","author":"Geoff Graham","date":"August 30, 2021","format":false,"excerpt":"A bonafide CSS trick if there ever was one! @ShadowShahriar created a CodePen demo that uses pseudo-elements to place commas between list items that are displayed inline, and the result is a natural-looking complete sentence with proper punctuation. CodePen Embed Fallback How it works The trick? First, it's to make\u2026","rel":"","context":"In &quot;Links&quot;","block_context":{"text":"Links","link":"https:\/\/css-tricks.com\/category\/links\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/08\/inline-list.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/08\/inline-list.jpg?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/08\/inline-list.jpg?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/08\/inline-list.jpg?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/08\/inline-list.jpg?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":334360,"url":"https:\/\/css-tricks.com\/weekly-platform-news-webkit-autofill-using-cursor-pointer-delaying-autoplay-videos\/","url_meta":{"origin":395223,"position":5},"title":"Weekly Platform News: WebKit autofill, Using Cursor Pointer, Delaying Autoplay Videos","author":"\u0160ime Vidas","date":"February 12, 2021","format":false,"excerpt":"In this week's roundup, WebKit's prefixed autofill becomes a standard, the pointer cursor is for more than just links, and browsers are jumping on board to delay videos set to autoplay until they're in view... plus more! Let's jump right into it. CSS\u00a0::-webkit-autofill\u00a0has become a standard feature Chrome, Safari, and\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/02\/wpn-20210212.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/02\/wpn-20210212.jpg?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/02\/wpn-20210212.jpg?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/02\/wpn-20210212.jpg?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/02\/wpn-20210212.jpg?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395223"}],"version-history":[{"count":10,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395223\/revisions"}],"predecessor-version":[{"id":395932,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395223\/revisions\/395932"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/274215"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":395878,"date":"2026-06-25T08:11:38","date_gmt":"2026-06-25T14:11:38","guid":{"rendered":"https:\/\/css-tricks.com\/?p=395878"},"modified":"2026-06-25T08:11:42","modified_gmt":"2026-06-25T14:11:42","slug":"quick-hit-153","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/quick-hit-153\/","title":{"rendered":"Quick Hit #153"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.firefox.com\/firefox\/154.0a1\/releasenotes\/\" rel=\"noopener\">Firefox 154<\/a> (Nightly) ships <a href=\"https:\/\/css-tricks.com\/almanac\/functions\/p\/progress\/\"><code>progress()<\/code><\/a>, advanced <a href=\"https:\/\/css-tricks.com\/almanac\/functions\/a\/attr\/\"><code>attr()<\/code><\/a>, and a UI for <code>&lt;input type=\"time\"><\/code> and <code>&lt;input type=\"datetime-local\"><\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firefox 154 (Nightly) ships progress(), advanced attr(), and a UI for &lt;input type=&#8221;time&#8221;> and &lt;input type=&#8221;datetime-local&#8221;>.<\/p>\n","protected":false},"author":288677,"featured_media":300990,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"c2c_always_allow_admin_comments":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19079],"tags":[1351,478,1471,19179],"class_list":["post-395878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quick-hits","tag-attr","tag-css","tag-firefox","tag-progress-2"],"acf":{"show_toc":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/12\/css-tricks-logo-gradient-outline.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[{"id":6788,"url":"https:\/\/css-tricks.com\/local-previews-of-images\/","url_meta":{"origin":395878,"position":0},"title":"Local Previews of Images from File Inputs (fail)","author":"Chris Coyier","date":"July 19, 2010","format":false,"excerpt":"A little while back there was a guest post about Ajax image previews. It's a nice technique but it left myself and a few other commenters thinking: wouldn't it be cool if you didn't have to upload the image at all to preview it? After all, the image is on\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2010\/07\/inputwithpreview.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":261888,"url":"https:\/\/css-tricks.com\/css-attr-function-got-nothin-custom-properties\/","url_meta":{"origin":395878,"position":1},"title":"The CSS attr() function got nothin&#8217; on custom properties","author":"Chris Coyier","date":"November 2, 2017","format":false,"excerpt":"Normally, the connection between CSS and HTML is that CSS selectors match HTML elements, and the CSS styles them. CSS doesn't know about the actual content in the HTML. But there is a way CSS can get its hands on data in HTML, so long as that data is within\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":384919,"url":"https:\/\/css-tricks.com\/a-css-only-star-rating-component-and-more-part-2\/","url_meta":{"origin":395878,"position":2},"title":"A CSS-Only Star Rating Component and More! (Part 2)","author":"Temani Afif","date":"March 7, 2025","format":false,"excerpt":"In this second article of a two-part series, Temani Afif demonstrates an alternative approach to creating the star rating component from the first article using experimental scroll-driven animations rather than using the border-image property.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":384906,"url":"https:\/\/css-tricks.com\/a-css-only-star-rating-component-and-more-part-1\/","url_meta":{"origin":395878,"position":3},"title":"A CSS-Only Star Rating Component and More! (Part 1)","author":"Temani Afif","date":"February 28, 2025","format":false,"excerpt":"In this article, you'll learn how to make a full-on star rating component out of nothing but a single input element and vanilla CSS.","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/07\/star-pattern.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":9512,"url":"https:\/\/css-tricks.com\/choice-value-pair\/","url_meta":{"origin":395878,"position":4},"title":"Choice &#038; Value Pair","author":"Chris Coyier","date":"May 24, 2011","format":false,"excerpt":"Let's say in a form you need to allow the user to select a single unique choice. That's the territory of either a select dropdown menu or a group of radio buttons. Now let's say there is direct follow-up question to each particular choice. For example, an order form for\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2011\/05\/choicevalue.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":252357,"url":"https:\/\/css-tricks.com\/build-custom-serverless-cms-part-2\/","url_meta":{"origin":395878,"position":5},"title":"Build a Custom Serverless CMS: Part 2","author":"John Polacek","date":"March 8, 2017","format":false,"excerpt":"In our previous proof-of-concept demo, we built a bare bones admin for generating a web page with the ability to edit some text on the page and set the site title and description. For this next demo, we build on our example and add rich text editing and image upload\u2026","rel":"","context":"In &quot;Articles&quot;","block_context":{"text":"Articles","link":"https:\/\/css-tricks.com\/category\/articles\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/01\/static-site.png?fit=863%2C240&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/01\/static-site.png?fit=863%2C240&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/01\/static-site.png?fit=863%2C240&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2017\/01\/static-site.png?fit=863%2C240&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/288677"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=395878"}],"version-history":[{"count":2,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395878\/revisions"}],"predecessor-version":[{"id":395885,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/395878\/revisions\/395885"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/300990"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=395878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=395878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=395878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]