[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"verticals":3,"search-suggestions":44,"article-css-mask-image-scroll-fade-edges":93,"path-membership-css-mask-image-scroll-fade-edges":260,"related-css-mask-image-scroll-fade-edges":261,"code:css:true:ai7znn":388,"code:css:true:ir38l0":389,"comments-01a21cc5-8175-722c-b0a2-f4c1db300af5":390},[4,20,32],{"id":5,"slug":6,"name":7,"tagline":8,"description":9,"accentFrom":10,"accentTo":11,"icon":12,"defaultLocale":13,"locales":14,"features":16,"position":19},"019fe637-3d33-714b-b57f-23e163ffca0c","dev","Web Development","Read it. Run it. Prove it.","A post a day on modern web development — most with an editable playground and a quiz that explains every answer. Free, no account needed.","violet-500","cyan-400","◇","en",[13,15],"fa",{"courses":17,"paths":17,"articles":17,"exams":18,"flashcards":18,"packages":17,"community":17,"certificates":17,"teams":17,"commerce":17},true,false,0,{"id":21,"slug":22,"name":23,"tagline":24,"description":25,"accentFrom":26,"accentTo":10,"icon":27,"defaultLocale":13,"locales":28,"features":30,"position":31},"019fe637-3dc2-754c-8657-0f175bfee7c6","lang","Languages","Learn a language the way you learn a codebase.","Grammar explained the way good documentation explains an API — one idea at a time, each with a quiz.","amber-400","⌘",[13,15,29],"es",{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":17,"packages":18,"community":17,"certificates":17,"teams":18,"commerce":18},2,{"id":33,"slug":34,"name":35,"tagline":36,"description":37,"accentFrom":38,"accentTo":39,"icon":40,"defaultLocale":13,"locales":41,"features":42,"position":43},"7b3c16f2-931d-410e-802e-e1fa4edab7de","soft","Soft Skills","The half of the job nobody wrote documentation for.","Weekly, on the parts of working life that decide more than your code does — first weeks, meetings, interviews, promotions, and the people around you. Written from what actually happens, and recorded as a podcast you can listen to on the walk.","emerald-400","teal-300","◉",[13],{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":18,"packages":18,"community":17,"certificates":18,"teams":18,"commerce":18},3,[45,49,53,57,61,65,69,73,77,81,85,89],{"slug":46,"name":47,"articles":48},"webdev","Webdev",198,{"slug":50,"name":51,"articles":52},"javascript","Javascript",157,{"slug":54,"name":55,"articles":56},"frontend","Frontend",104,{"slug":58,"name":59,"articles":60},"tutorial","Tutorial",88,{"slug":62,"name":63,"articles":64},"css","Css",57,{"slug":66,"name":67,"articles":68},"typescript","Typescript",37,{"slug":70,"name":71,"articles":72},"performance","Performance",33,{"slug":74,"name":75,"articles":76},"programming","Programming",26,{"slug":78,"name":79,"articles":80},"react","React",23,{"slug":82,"name":83,"articles":84},"node","Node",19,{"slug":86,"name":87,"articles":88},"browser","Browser",18,{"slug":90,"name":91,"articles":92},"nextjs","Nextjs",14,{"id":94,"slug":95,"title":96,"subtitle":97,"excerpt":98,"coverUrl":99,"locale":13,"readingMinutes":100,"publishedAt":101,"viewCount":102,"likeCount":19,"commentCount":19,"author":103,"vertical":108,"topic":109,"tags":111,"_count":116,"playground":118,"body":120,"bodyMd":243,"seo":244,"translationGroupId":247,"series":97,"podcastUrl":97,"verticalId":5,"thread":248,"assessments":250,"translations":256,"quiz":258},"01a21cc5-8175-722c-b0a2-f4c1db300af5","css-mask-image-scroll-fade-edges","CSS mask-image Explained: Fade Edges Without Gradient Divs",null,"Horizontally scrolling chip lists and tab bars usually hint 'there's more to scroll' with an absolutely positioned gradient div glued to each edge. It works on a solid background and falls apart on anything else. mask-image fades the actual content, not a fake overlay.","\u002Fmedia\u002Fcovers\u002Fcss-mask-image-scroll-fade-edges.png",5,"2026-12-02T01:45:45.100Z",12,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},"019fe637-3c25-7088-9034-39c9f15dc3c8","Parsa Jiravand","parsa","Frontend engineer · building bestpractic",{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},"CSS",[112,113,114,115],{"slug":62,"name":63,"color":97},{"slug":54,"name":55,"color":97},{"slug":46,"name":47,"color":97},{"slug":58,"name":59,"color":97},{"assessments":117},1,{"slug":95,"title":119},"mask-image vs. gradient-overlay div — interactive playground",{"blocks":121,"version":117},[122,126,129,132,137,140,143,147,150,153,156,159,163,166,170,173,176,179,182,185,188,191,194,197,200,203,206,209,212,215,218,221,224,227,230,233,236],{"id":123,"html":124,"type":125},"b1","\u003Cp>Open any app with a horizontally scrolling row — a chip list, a tab bar, a row of story avatars — and look at the right edge. Chances are there&#39;s a soft fade there, a little visual whisper that says &quot;there&#39;s more, keep scrolling.&quot; Now switch the page to dark mode, or scroll until a product photo sits right under that fade.\u003C\u002Fp>","paragraph",{"id":127,"html":128,"type":125},"b2","\u003Cp>Watch the fade turn into a flat, wrong-colored smudge sitting on top of the photo.\u003C\u002Fp>",{"id":130,"html":131,"type":125},"b3","\u003Cp>That&#39;s not a rendering bug. That&#39;s the fade working exactly as built — and the way it&#39;s built is the problem.\u003C\u002Fp>",{"id":133,"code":134,"type":135,"language":62,"highlight":136},"b4",".scroll-row { position: relative; overflow-x: auto; }\n\n.scroll-row::after {\n  content: \"\";\n  position: absolute;\n  top: 0; right: 0; bottom: 0;\n  width: 40px;\n  background: linear-gradient(to right, transparent, white);\n  pointer-events: none;\n}","code",[],{"id":138,"html":139,"type":125},"b5","\u003Cp>That&#39;s the standard trick, and it&#39;s everywhere. An absolutely positioned pseudo-element, pinned to the edge, painted with a gradient from transparent to a hardcoded color — usually whatever the background happens to be that day. It looks completely fine in whatever screenshot it was built against.\u003C\u002Fp>",{"id":141,"html":142,"type":125},"b6","\u003Cp>\u003Cstrong>Before you keep reading: guess what happens the first time a designer swaps that background for an image.\u003C\u002Fstrong> You already know, because you&#39;ve seen it happen to someone else&#39;s component.\u003C\u002Fp>",{"id":144,"html":145,"text":145,"type":146,"level":31},"b7","The obvious fix, and why it was never going to work","heading",{"id":148,"html":149,"type":125},"b8","\u003Cp>The pseudo-element isn&#39;t fading anything. It&#39;s painting a second, opaque layer of &quot;white, going transparent&quot; directly on top of whatever&#39;s really there, and hoping the two colors happen to match. When the row sits on a flat \u003Ccode>#fff\u003C\u002Fcode> background, the illusion holds — the gradient blends into the page and nobody notices there&#39;s a div-shaped lie sitting on top of the content.\u003C\u002Fp>",{"id":151,"html":152,"type":125},"b9","\u003Cp>The moment that assumption breaks — dark mode, a photo, a gradient background, a themeable design system — the lie is visible. You get a pale rectangle sitting over a dark background, or a hard-edged color band stamped across a product image, because the overlay never had any idea what was underneath it. It can&#39;t. It&#39;s a separate element, painted independently, guessing at a color.\u003C\u002Fp>",{"id":154,"html":155,"type":125},"b10","\u003Cp>So the &quot;fix&quot; becomes: read the computed background color in JS, update a CSS variable, recompute it on theme change, recompute it again if the row ever scrolls under something with a different background per item. You end up maintaining a tiny color-matching service for a decoration.\u003C\u002Fp>",{"id":157,"html":158,"type":125},"b11","\u003Cp>\u003Cstrong>Here&#39;s the part that&#39;s easy to miss: the problem was never the color. It&#39;s that you&#39;re trying to hide pixels with more pixels\u003C\u002Fstrong>, instead of making the pixels that are already there fade out.\u003C\u002Fp>",{"id":160,"html":161,"text":162,"type":146,"level":31},"b12","What actually fades the content: \u003Ccode>mask-image\u003C\u002Fcode>","What actually fades the content: mask-image",{"id":164,"html":165,"type":125},"b13","\u003Cp>CSS masking does something structurally different from an overlay. Instead of painting a new layer on top, \u003Ccode>mask-image\u003C\u002Fcode> takes an image — including a CSS gradient — and uses its alpha channel to control the \u003Cem>opacity of the element it&#39;s applied to\u003C\u002Fem>. Where the mask is fully opaque, the element renders normally. Where the mask fades to transparent, the element fades to transparent too — whatever is actually being rendered there: a photo, a solid chip, a gradient, dark-mode content, all of it.\u003C\u002Fp>",{"id":167,"code":168,"type":135,"language":62,"highlight":169},"b14",".scroll-row {\n  overflow-x: auto;\n  -webkit-mask-image: linear-gradient(\n    to right,\n    transparent, black 24px,\n    black calc(100% - 24px), transparent\n  );\n  mask-image: linear-gradient(\n    to right,\n    transparent, black 24px,\n    black calc(100% - 24px), transparent\n  );\n}",[],{"id":171,"html":172,"type":125},"b15","\u003Cp>No extra element. No hardcoded color to keep in sync with the theme. The gradient&#39;s actual color doesn&#39;t matter at all here — \u003Ccode>black\u003C\u002Fcode> and \u003Ccode>white\u003C\u002Fcode> behave identically, because what the browser reads is the \u003Cem>alpha\u003C\u002Fem> value at each point along the gradient, not the hue. \u003Ccode>transparent\u003C\u002Fcode> has 0 alpha, \u003Ccode>black\u003C\u002Fcode> has full alpha, and everything in between blends smoothly — so the row&#39;s own content, whatever it is, fades with it.\u003C\u002Fp>",{"id":174,"html":175,"type":125},"b16","\u003Cp>That \u003Ccode>-webkit-\u003C\u002Fcode> line isn&#39;t decoration — it&#39;s the one still worth keeping around. Masking has solid support across current Chrome, Firefox, and Safari, but it shipped under the \u003Ccode>-webkit-\u003C\u002Fcode> prefix first and the unprefixed property arrived later, so pairing both costs nothing and covers the stragglers. Browsers ignore the prefixed declaration they don&#39;t need and use the one they do.\u003C\u002Fp>",{"id":177,"html":178,"type":125},"b17","\u003C!-- playground:start -->",{"id":180,"html":181,"text":181,"type":146,"level":31},"b18","🎮 Try it yourself",{"id":183,"html":184,"type":125},"b19","\u003Cp>\u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-mask-image-scroll-fade-edges\u002Fplayground\">▶️ Open the interactive playground →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":186,"html":187,"type":125},"b20","\u003Cp>\u003Cem>Runs right in your browser — poke at it and watch the concept react live.\u003C\u002Fem>\u003C\u002Fp>",{"id":189,"html":190,"type":125},"b21","\u003C!-- playground:end -->",{"id":192,"html":193,"type":125},"b22","\u003Cp>Try it yourself: the live demo below puts the overlay-div trick and \u003Ccode>mask-image\u003C\u002Fcode> side by side over the exact same scrolling content, lets you drag the fade width, and flips the background so you can watch one of them break.\u003C\u002Fp>",{"id":195,"html":196,"text":196,"type":146,"level":31},"b23","The thing the overlay trick never had to answer for",{"id":198,"html":199,"type":125},"b24","\u003Cp>Here&#39;s a question the gradient-div approach never had to face, because it never touched the real content: what happens to the stuff \u003Cem>inside\u003C\u002Fem> the fade? With \u003Ccode>mask-image\u003C\u002Fcode>, the answer is simple and a little surprising — the content is still fully there. Masking only ever changes what gets \u003Cstrong>painted\u003C\u002Fstrong>; it never removes anything from layout, from the DOM, or from the accessibility tree.\u003C\u002Fp>",{"id":201,"html":202,"type":125},"b25","\u003Cp>That means a masked-out chip at the edge of the row is still focusable, still readable by a screen reader, and still scrolls into full view the instant the user keeps scrolling — the fade is purely visual, the same way \u003Ccode>-webkit-line-clamp\u003C\u002Fcode> only ever clips what&#39;s painted, never what&#39;s selectable. If you were relying on the overlay div to also \u003Cem>block\u003C\u002Fem> interaction with the edge content — don&#39;t; \u003Ccode>pointer-events: none\u003C\u002Fcode> on the old pseudo-element did that job, and a bare \u003Ccode>mask-image\u003C\u002Fcode> won&#39;t do it for you. Mask what&#39;s painted, and handle interaction separately if you actually need to.\u003C\u002Fp>",{"id":204,"html":205,"text":205,"type":146,"level":31},"b26","What to actually ship",{"id":207,"html":208,"type":125},"b27","\u003Cp>If your scroll row&#39;s fade is still two pseudo-elements and a color variable you update on every theme change, you&#39;re not doing anything wrong exactly — you&#39;re doing extra work for a worse result. Swap it for a \u003Ccode>mask-image\u003C\u002Fcode> gradient, keep the \u003Ccode>-webkit-\u003C\u002Fcode> line next to it, and delete the JS that was keeping the fade color in sync with the background. The fade stops needing to know what&#39;s behind it, because it&#39;s not painting over it anymore — it&#39;s revealing it, gradually, and that&#39;s the whole trick.\u003C\u002Fp>",{"id":210,"html":211,"type":125},"b28","\u003Cp>What&#39;s the ugliest &quot;fake the background color&quot; hack sitting in your CSS right now that this would quietly replace? I&#39;d genuinely like to know.\u003C\u002Fp>",{"id":213,"html":214,"type":125},"b29","\u003C!-- quiz:start -->",{"id":216,"html":217,"text":217,"type":146,"level":31},"b30","🧠 Test yourself",{"id":219,"html":220,"type":125},"b31","\u003Cp>Think it clicked? \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-mask-image-scroll-fade-edges\u002Fquiz\">Take the 8-question quiz →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":222,"html":223,"type":125},"b32","\u003Cp>\u003Cem>Instant feedback, a hint on every question, and an explanation for each answer — right or wrong.\u003C\u002Fem>\u003C\u002Fp>",{"id":225,"html":226,"type":125},"b33","\u003C!-- quiz:end -->",{"id":228,"type":229},"b34","divider",{"id":231,"html":232,"type":125},"b35","\u003Cp>🚀 \u003Cstrong>Want more like this?\u003C\u002Fstrong> Every guide, playground, and quiz lives on \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">bestpractic.org\u003C\u002Fa>\u003C\u002Fstrong> — open it and \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">sign up free\u003C\u002Fa>\u003C\u002Fstrong> so the next one finds you.\u003C\u002Fp>",{"id":234,"html":235,"type":125},"b36","\u003Cp>\u003Cem>Thanks for reading! Let&#39;s stay connected:\u003C\u002Fem>\u003C\u002Fp>",{"id":237,"type":238,"items":239,"ordered":18},"b37","list",[240,241,242],"⭐ \u003Cstrong>GitHub\u003C\u002Fstrong> — follow me and star the projects: \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fparsajiravand\">github.com\u002Fparsajiravand\u003C\u002Fa>","💬 \u003Cstrong>Discord\u003C\u002Fstrong> — join the frontend best-practices community: \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ\">discord.gg\u002Fd9KRhuAwQ\u003C\u002Fa>","📸 \u003Cstrong>Instagram\u003C\u002Fstrong> — frontend best practices, daily: \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F\">@bestpractice___\u003C\u002Fa>","Open any app with a horizontally scrolling row — a chip list, a tab bar, a row of story avatars — and look at the right edge. Chances are there's a soft fade there, a little visual whisper that says \"there's more, keep scrolling.\" Now switch the page to dark mode, or scroll until a product photo sits right under that fade.\n\nWatch the fade turn into a flat, wrong-colored smudge sitting on top of the photo.\n\nThat's not a rendering bug. That's the fade working exactly as built — and the way it's built is the problem.\n\n```css\n.scroll-row { position: relative; overflow-x: auto; }\n\n.scroll-row::after {\n  content: \"\";\n  position: absolute;\n  top: 0; right: 0; bottom: 0;\n  width: 40px;\n  background: linear-gradient(to right, transparent, white);\n  pointer-events: none;\n}\n```\n\nThat's the standard trick, and it's everywhere. An absolutely positioned pseudo-element, pinned to the edge, painted with a gradient from transparent to a hardcoded color — usually whatever the background happens to be that day. It looks completely fine in whatever screenshot it was built against.\n\n**Before you keep reading: guess what happens the first time a designer swaps that background for an image.** You already know, because you've seen it happen to someone else's component.\n\n## The obvious fix, and why it was never going to work\n\nThe pseudo-element isn't fading anything. It's painting a second, opaque layer of \"white, going transparent\" directly on top of whatever's really there, and hoping the two colors happen to match. When the row sits on a flat `#fff` background, the illusion holds — the gradient blends into the page and nobody notices there's a div-shaped lie sitting on top of the content.\n\nThe moment that assumption breaks — dark mode, a photo, a gradient background, a themeable design system — the lie is visible. You get a pale rectangle sitting over a dark background, or a hard-edged color band stamped across a product image, because the overlay never had any idea what was underneath it. It can't. It's a separate element, painted independently, guessing at a color.\n\nSo the \"fix\" becomes: read the computed background color in JS, update a CSS variable, recompute it on theme change, recompute it again if the row ever scrolls under something with a different background per item. You end up maintaining a tiny color-matching service for a decoration.\n\n**Here's the part that's easy to miss: the problem was never the color. It's that you're trying to hide pixels with more pixels**, instead of making the pixels that are already there fade out.\n\n## What actually fades the content: `mask-image`\n\nCSS masking does something structurally different from an overlay. Instead of painting a new layer on top, `mask-image` takes an image — including a CSS gradient — and uses its alpha channel to control the *opacity of the element it's applied to*. Where the mask is fully opaque, the element renders normally. Where the mask fades to transparent, the element fades to transparent too — whatever is actually being rendered there: a photo, a solid chip, a gradient, dark-mode content, all of it.\n\n```css\n.scroll-row {\n  overflow-x: auto;\n  -webkit-mask-image: linear-gradient(\n    to right,\n    transparent, black 24px,\n    black calc(100% - 24px), transparent\n  );\n  mask-image: linear-gradient(\n    to right,\n    transparent, black 24px,\n    black calc(100% - 24px), transparent\n  );\n}\n```\n\nNo extra element. No hardcoded color to keep in sync with the theme. The gradient's actual color doesn't matter at all here — `black` and `white` behave identically, because what the browser reads is the *alpha* value at each point along the gradient, not the hue. `transparent` has 0 alpha, `black` has full alpha, and everything in between blends smoothly — so the row's own content, whatever it is, fades with it.\n\nThat `-webkit-` line isn't decoration — it's the one still worth keeping around. Masking has solid support across current Chrome, Firefox, and Safari, but it shipped under the `-webkit-` prefix first and the unprefixed property arrived later, so pairing both costs nothing and covers the stragglers. Browsers ignore the prefixed declaration they don't need and use the one they do.\n\n\u003C!-- playground:start -->\n\n## 🎮 Try it yourself\n\n**[▶️ Open the interactive playground →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-mask-image-scroll-fade-edges\u002Fplayground)**\n\n_Runs right in your browser — poke at it and watch the concept react live._\n\n\u003C!-- playground:end -->\n\nTry it yourself: the live demo below puts the overlay-div trick and `mask-image` side by side over the exact same scrolling content, lets you drag the fade width, and flips the background so you can watch one of them break.\n\n## The thing the overlay trick never had to answer for\n\nHere's a question the gradient-div approach never had to face, because it never touched the real content: what happens to the stuff *inside* the fade? With `mask-image`, the answer is simple and a little surprising — the content is still fully there. Masking only ever changes what gets **painted**; it never removes anything from layout, from the DOM, or from the accessibility tree.\n\nThat means a masked-out chip at the edge of the row is still focusable, still readable by a screen reader, and still scrolls into full view the instant the user keeps scrolling — the fade is purely visual, the same way `-webkit-line-clamp` only ever clips what's painted, never what's selectable. If you were relying on the overlay div to also *block* interaction with the edge content — don't; `pointer-events: none` on the old pseudo-element did that job, and a bare `mask-image` won't do it for you. Mask what's painted, and handle interaction separately if you actually need to.\n\n## What to actually ship\n\nIf your scroll row's fade is still two pseudo-elements and a color variable you update on every theme change, you're not doing anything wrong exactly — you're doing extra work for a worse result. Swap it for a `mask-image` gradient, keep the `-webkit-` line next to it, and delete the JS that was keeping the fade color in sync with the background. The fade stops needing to know what's behind it, because it's not painting over it anymore — it's revealing it, gradually, and that's the whole trick.\n\nWhat's the ugliest \"fake the background color\" hack sitting in your CSS right now that this would quietly replace? I'd genuinely like to know.\n\n\u003C!-- quiz:start -->\n\n## 🧠 Test yourself\n\nThink it clicked? **[Take the 8-question quiz →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-mask-image-scroll-fade-edges\u002Fquiz)**\n\n_Instant feedback, a hint on every question, and an explanation for each answer — right or wrong._\n\n\u003C!-- quiz:end -->\n\n---\n\n🚀 **Want more like this?** Every guide, playground, and quiz lives on **[bestpractic.org](https:\u002F\u002Fbestpractic.org\u002F)** — open it and **[sign up free](https:\u002F\u002Fbestpractic.org\u002F)** so the next one finds you.\n\n*Thanks for reading! Let's stay connected:*\n\n- ⭐ **GitHub** — follow me and star the projects: [github.com\u002Fparsajiravand](https:\u002F\u002Fgithub.com\u002Fparsajiravand)\n- 💬 **Discord** — join the frontend best-practices community: [discord.gg\u002Fd9KRhuAwQ](https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ)\n- 📸 **Instagram** — frontend best practices, daily: [@bestpractice___](https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F)",{"title":96,"canonical":245,"description":246},"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-mask-image-scroll-fade-edges","Horizontally scrolling chip lists and tab bars usually hint 'there's more to scroll' with an absolutely positioned gradient div glued to each edge. It works on a solid background a","01a21cc5-8176-7430-ab5f-901351580bd2",{"id":249,"locked":18},"01a21cc5-8190-73ae-b713-b8a760ae466b",[251],{"id":252,"slug":95,"title":253,"_count":254},"01a21cc5-81a9-7384-a16b-f4b277aaf41d","CSS mask-image: fading content without overlay divs",{"questions":255},8,[257],{"locale":13,"slug":95},{"id":252,"slug":95,"title":253,"_count":259,"questionCount":255},{"questions":255},[],{"items":262,"meta":385},[263,275,294,312,330,348,367],{"id":94,"slug":95,"title":96,"subtitle":97,"excerpt":98,"coverUrl":99,"locale":13,"readingMinutes":100,"publishedAt":101,"viewCount":264,"likeCount":19,"commentCount":19,"author":265,"vertical":266,"topic":267,"tags":268,"_count":273,"playground":274,"hasQuiz":17,"hasPlayground":17},13,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[269,270,271,272],{"slug":62,"name":63,"color":97},{"slug":54,"name":55,"color":97},{"slug":46,"name":47,"color":97},{"slug":58,"name":59,"color":97},{"assessments":117},{"slug":95},{"id":276,"slug":277,"title":278,"subtitle":97,"excerpt":279,"coverUrl":280,"locale":13,"readingMinutes":281,"publishedAt":282,"viewCount":283,"likeCount":19,"commentCount":19,"author":284,"vertical":285,"topic":286,"tags":287,"_count":292,"playground":293,"hasQuiz":17,"hasPlayground":17},"01a1fce0-c3d4-737b-8a48-5669d1350ff2","css-transition-behavior-allow-discrete","CSS Transitions Skip display: none. transition-behavior Fixes That.","You can finally animate a dialog in from display: none without JavaScript — transition-behavior and @starting-style turn the jump-cut into a real transition.","\u002Fmedia\u002Fcovers\u002Fcss-transition-behavior-allow-discrete.png",6,"2026-11-27T11:46:28.711Z",183,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[288,289,290,291],{"slug":62,"name":63,"color":97},{"slug":46,"name":47,"color":97},{"slug":54,"name":55,"color":97},{"slug":58,"name":59,"color":97},{"assessments":117},{"slug":277},{"id":295,"slug":296,"title":297,"subtitle":97,"excerpt":298,"coverUrl":299,"locale":13,"readingMinutes":281,"publishedAt":300,"viewCount":301,"likeCount":19,"commentCount":19,"author":302,"vertical":303,"topic":304,"tags":305,"_count":310,"playground":311,"hasQuiz":17,"hasPlayground":17},"01a1df1b-24b4-759b-be78-50479b1bfe26","scrollbar-color-native-scrollbar-styling","I Deleted My Scrollbar Hacks. `scrollbar-color` Replaced Them.","A dashboard's scrollbar matched Figma in Chrome and looked broken in Firefox. scrollbar-color and scrollbar-width fix that with two lines of standard CSS — no vendor prefixes, no UA sniffing.","\u002Fmedia\u002Fcovers\u002Fscrollbar-color-native-scrollbar-styling.png","2026-11-27T11:42:54.989Z",148,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[306,307,308,309],{"slug":62,"name":63,"color":97},{"slug":46,"name":47,"color":97},{"slug":54,"name":55,"color":97},{"slug":58,"name":59,"color":97},{"assessments":117},{"slug":296},{"id":313,"slug":314,"title":315,"subtitle":97,"excerpt":316,"coverUrl":317,"locale":13,"readingMinutes":100,"publishedAt":318,"viewCount":319,"likeCount":19,"commentCount":19,"author":320,"vertical":321,"topic":322,"tags":323,"_count":328,"playground":329,"hasQuiz":17,"hasPlayground":17},"01a1df1b-36a8-772a-9e7a-3586a0ebff65","css-scroll-margin-top-anchor-offset","Your Sticky Header Is Hiding Anchor Links. `scroll-margin-top` Fixes It.","Clicking a table-of-contents link lands the heading right behind your sticky nav, half-hidden. The fix isn't a JavaScript scroll offset — it's one CSS property the browser already checks before it scrolls.","\u002Fmedia\u002Fcovers\u002Fcss-scroll-margin-top-anchor-offset.png","2026-11-21T06:52:41.283Z",350,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[324,325,326,327],{"slug":62,"name":63,"color":97},{"slug":46,"name":47,"color":97},{"slug":54,"name":55,"color":97},{"slug":58,"name":59,"color":97},{"assessments":117},{"slug":314},{"id":331,"slug":332,"title":333,"subtitle":97,"excerpt":334,"coverUrl":335,"locale":13,"readingMinutes":281,"publishedAt":336,"viewCount":337,"likeCount":19,"commentCount":19,"author":338,"vertical":339,"topic":340,"tags":341,"_count":346,"playground":347,"hasQuiz":17,"hasPlayground":17},"01a1af7a-c595-77be-8e0a-dea27ce0db13","variable-fonts-one-file-many-weights","I Was Shipping Five Font Files. One Variable Font Replaced Them All.","Regular, Medium, Semibold, Bold, Bold Italic — five @font-face blocks, five network requests, just to render a design system's type scale. A single variable font file replaces all of them, and it's been supported everywhere since 2018.","\u002Fmedia\u002Fcovers\u002Fvariable-fonts-one-file-many-weights.png","2026-11-15T12:10:51.143Z",453,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[342,343,344,345],{"slug":62,"name":63,"color":97},{"slug":46,"name":47,"color":97},{"slug":54,"name":55,"color":97},{"slug":70,"name":71,"color":97},{"assessments":117},{"slug":332},{"id":349,"slug":350,"title":351,"subtitle":97,"excerpt":352,"coverUrl":353,"locale":13,"readingMinutes":354,"publishedAt":355,"viewCount":356,"likeCount":19,"commentCount":19,"author":357,"vertical":358,"topic":359,"tags":360,"_count":365,"playground":366,"hasQuiz":17,"hasPlayground":17},"01a1c0f9-dcbd-71ce-acad-1012bf44027c","overflow-clip-vs-overflow-hidden-sticky","overflow: hidden breaks position: sticky. overflow: clip doesn't.","A sticky header that worked in isolation stops sticking the moment it's dropped inside a rounded-corner card with overflow: hidden. The card isn't scrollable — but the browser doesn't care. overflow: clip is the fix, and it's been quietly ready for a while.","\u002Fmedia\u002Fcovers\u002Foverflow-clip-vs-overflow-hidden-sticky.png",4,"2026-11-15T12:07:47.081Z",372,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[361,362,363,364],{"slug":62,"name":63,"color":97},{"slug":46,"name":47,"color":97},{"slug":54,"name":55,"color":97},{"slug":58,"name":59,"color":97},{"assessments":117},{"slug":350},{"id":368,"slug":369,"title":370,"subtitle":97,"excerpt":371,"coverUrl":372,"locale":13,"readingMinutes":281,"publishedAt":373,"viewCount":374,"likeCount":19,"commentCount":19,"author":375,"vertical":376,"topic":377,"tags":378,"_count":383,"playground":384,"hasQuiz":17,"hasPlayground":17},"01a1a007-b7cf-743d-a21f-35adebf60420","prefers-color-scheme-theme-flash","Stop Blaming `prefers-color-scheme` For Your Theme Flash","Your dark mode toggle flashes light for a frame on every reload — but prefers-color-scheme alone never does that. The real bug is where your theme script runs relative to the browser's first paint.","\u002Fmedia\u002Fcovers\u002Fprefers-color-scheme-theme-flash.png","2026-11-09T15:42:44.790Z",522,{"id":104,"name":105,"username":106,"avatarUrl":97,"headline":107},{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":62,"name":110},[379,380,381,382],{"slug":62,"name":63,"color":97},{"slug":50,"name":51,"color":97},{"slug":46,"name":47,"color":97},{"slug":54,"name":55,"color":97},{"assessments":117},{"slug":369},{"page":117,"perPage":386,"total":64,"totalPages":387},7,9,"\u003Cdiv class=\"shj shj-lang-css shj-multiline\" data-lang=\"css\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003Cdiv>3\u003C\u002Fdiv>\u003Cdiv>4\u003C\u002Fdiv>\u003Cdiv>5\u003C\u002Fdiv>\u003Cdiv>6\u003C\u002Fdiv>\u003Cdiv>7\u003C\u002Fdiv>\u003Cdiv>8\u003C\u002Fdiv>\u003Cdiv>9\u003C\u002Fdiv>\u003Cdiv>10\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-var\">.scroll-row\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan> \u003Cspan class=\"shj-var\">position\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">relative\u003C\u002Fspan>; \u003Cspan class=\"shj-var\">overflow-x\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">auto\u003C\u002Fspan>; \u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\n\n\u003Cspan class=\"shj-var\">.scroll-row\u003C\u002Fspan>\u003Cspan class=\"shj-var\">::after\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n  \u003Cspan class=\"shj-var\">content\u003C\u002Fspan>: \u003Cspan class=\"shj-str\">\"\"\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-var\">position\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">absolute\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-var\">top\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">0\u003C\u002Fspan>; \u003Cspan class=\"shj-var\">right\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">0\u003C\u002Fspan>; \u003Cspan class=\"shj-var\">bottom\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">0\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-var\">width\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">40\u003C\u002Fspan>\u003Cspan class=\"shj-var\">px\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-var\">background\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">linear-gradient\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-num\">to\u003C\u002Fspan> \u003Cspan class=\"shj-num\">right\u003C\u002Fspan>, \u003Cspan class=\"shj-num\">transparent\u003C\u002Fspan>, \u003Cspan class=\"shj-num\">white\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-var\">pointer-events\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">none\u003C\u002Fspan>;\n\u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>","\u003Cdiv class=\"shj shj-lang-css shj-multiline\" data-lang=\"css\">\u003Cdiv class=\"shj-scroll\">\u003Cdiv class=\"shj-numbers\">\u003Cdiv>1\u003C\u002Fdiv>\u003Cdiv>2\u003C\u002Fdiv>\u003Cdiv>3\u003C\u002Fdiv>\u003Cdiv>4\u003C\u002Fdiv>\u003Cdiv>5\u003C\u002Fdiv>\u003Cdiv>6\u003C\u002Fdiv>\u003Cdiv>7\u003C\u002Fdiv>\u003Cdiv>8\u003C\u002Fdiv>\u003Cdiv>9\u003C\u002Fdiv>\u003Cdiv>10\u003C\u002Fdiv>\u003Cdiv>11\u003C\u002Fdiv>\u003Cdiv>12\u003C\u002Fdiv>\u003Cdiv>13\u003C\u002Fdiv>\u003C\u002Fdiv>\u003Cdiv class=\"shj-code\">\u003Cspan class=\"shj-var\">.scroll-row\u003C\u002Fspan> \u003Cspan class=\"shj-bracket\">{\u003C\u002Fspan>\n  \u003Cspan class=\"shj-var\">overflow-x\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">auto\u003C\u002Fspan>;\n  -\u003Cspan class=\"shj-var\">webkit-mask-image\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">linear-gradient\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\n    \u003Cspan class=\"shj-num\">to\u003C\u002Fspan> \u003Cspan class=\"shj-num\">right\u003C\u002Fspan>,\n    \u003Cspan class=\"shj-num\">transparent\u003C\u002Fspan>, \u003Cspan class=\"shj-num\">black\u003C\u002Fspan> \u003Cspan class=\"shj-num\">24\u003C\u002Fspan>\u003Cspan class=\"shj-var\">px\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan>,\n    \u003Cspan class=\"shj-num\">black\u003C\u002Fspan> \u003Cspan class=\"shj-func\">calc\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-num\">100\u003C\u002Fspan>\u003Cspan class=\"shj-var\">%\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan> - \u003Cspan class=\"shj-num\">24\u003C\u002Fspan>\u003Cspan class=\"shj-var\">px\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>, \u003Cspan class=\"shj-num\">transparent\u003C\u002Fspan>\n  \u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n  \u003Cspan class=\"shj-var\">mask-image\u003C\u002Fspan>: \u003Cspan class=\"shj-num\">linear-gradient\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\n    \u003Cspan class=\"shj-num\">to\u003C\u002Fspan> \u003Cspan class=\"shj-num\">right\u003C\u002Fspan>,\n    \u003Cspan class=\"shj-num\">transparent\u003C\u002Fspan>, \u003Cspan class=\"shj-num\">black\u003C\u002Fspan> \u003Cspan class=\"shj-num\">24\u003C\u002Fspan>\u003Cspan class=\"shj-var\">px\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan>,\n    \u003Cspan class=\"shj-num\">black\u003C\u002Fspan> \u003Cspan class=\"shj-func\">calc\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">(\u003C\u002Fspan>\u003Cspan class=\"shj-num\">100\u003C\u002Fspan>\u003Cspan class=\"shj-var\">%\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan> - \u003Cspan class=\"shj-num\">24\u003C\u002Fspan>\u003Cspan class=\"shj-var\">px\u003C\u002Fspan>\u003Cspan class=\"shj-num\">\u003C\u002Fspan>\u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>, \u003Cspan class=\"shj-num\">transparent\u003C\u002Fspan>\n  \u003Cspan class=\"shj-bracket\">)\u003C\u002Fspan>;\n\u003Cspan class=\"shj-bracket\">}\u003C\u002Fspan>\u003C\u002Fdiv>\u003C\u002Fdiv>\u003C\u002Fdiv>",{"locked":18,"total":19,"comments":391},[]]