[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"verticals":3,"quiz-scrollbar-color-native-scrollbar-styling":44,"search-suggestions":60,"quiz-article-scrollbar-color-native-scrollbar-styling":109,"path-membership-scrollbar-color-native-scrollbar-styling":293},[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,{"id":45,"slug":46,"kind":47,"title":48,"description":49,"config":50,"verticalId":5,"vertical":55,"course":52,"_count":56,"access":57,"attempts":59,"questionCount":51},"01a1df1b-24ec-72ba-b9a4-48f74d89ffd0","scrollbar-color-native-scrollbar-styling","PRACTICE_QUIZ","Native scrollbar styling: scrollbar-color & scrollbar-width","Seven questions on the standard CSS Scrollbars Module versus the non-standard ::-webkit-scrollbar pseudo-elements — what each gives you, what neither does, and how to combine them without guessing the browser.",{"questionCount":51,"timeLimitSec":52,"shuffleQuestions":18,"shuffleOptions":17,"negativeMarking":19,"passScorePct":53,"maxAttempts":52,"revealAnswers":54,"allowFlagging":18,"allowBacktracking":17},7,null,70,"AFTER_SUBMIT",{"slug":6,"name":7},{"questions":51},{"allowed":17,"reason":58},"FREE",[],[61,65,69,73,77,81,85,89,93,97,101,105],{"slug":62,"name":63,"articles":64},"webdev","Webdev",195,{"slug":66,"name":67,"articles":68},"javascript","Javascript",156,{"slug":70,"name":71,"articles":72},"frontend","Frontend",103,{"slug":74,"name":75,"articles":76},"tutorial","Tutorial",85,{"slug":78,"name":79,"articles":80},"css","Css",56,{"slug":82,"name":83,"articles":84},"typescript","Typescript",36,{"slug":86,"name":87,"articles":88},"performance","Performance",33,{"slug":90,"name":91,"articles":92},"programming","Programming",26,{"slug":94,"name":95,"articles":96},"react","React",23,{"slug":98,"name":99,"articles":100},"node","Node",19,{"slug":102,"name":103,"articles":104},"browser","Browser",18,{"slug":106,"name":107,"articles":108},"nextjs","Nextjs",13,{"id":110,"slug":46,"title":111,"subtitle":52,"excerpt":112,"coverUrl":113,"locale":13,"readingMinutes":114,"publishedAt":115,"viewCount":116,"likeCount":19,"commentCount":19,"author":117,"vertical":122,"topic":123,"tags":125,"_count":130,"playground":132,"body":134,"bodyMd":279,"seo":280,"translationGroupId":283,"series":52,"podcastUrl":52,"verticalId":5,"thread":284,"assessments":286,"translations":289,"quiz":291},"01a1df1b-24b4-759b-be78-50479b1bfe26","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",6,"2026-11-27T11:42:54.989Z",8,{"id":118,"name":119,"username":120,"avatarUrl":52,"headline":121},"019fe637-3c25-7088-9034-39c9f15dc3c8","Parsa Jiravand","parsa","Frontend engineer · building bestpractic",{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":78,"name":124},"CSS",[126,127,128,129],{"slug":78,"name":79,"color":52},{"slug":62,"name":63,"color":52},{"slug":70,"name":71,"color":52},{"slug":74,"name":75,"color":52},{"assessments":131},1,{"slug":46,"title":133},"scrollbar-color — interactive playground",{"blocks":135,"version":131},[136,140,143,146,151,154,159,162,166,169,172,175,178,181,184,187,190,193,196,199,202,206,209,213,216,220,223,227,230,233,236,239,242,245,248,251,254,261,264,267,270,273],{"id":137,"html":138,"type":139},"b1","\u003Cp>The Figma handoff said &quot;thin gray scrollbar, rounded thumb, matches the rest of the UI.&quot; Twenty minutes and one Stack Overflow answer later, it did — in Chrome. The PR screenshot looked exactly like the design. It shipped.\u003C\u002Fp>","paragraph",{"id":141,"html":142,"type":139},"b2","\u003Cp>Three days later: &quot;scrollbars look broken in Firefox.&quot; Not styled-wrong broken. \u003Cem>Default-Windows-95 broken\u003C\u002Fem> — the fat gray bar with square ends, like the CSS had never been written at all.\u003C\u002Fp>",{"id":144,"html":145,"type":139},"b3","\u003Cp>It hadn&#39;t been. Not in Firefox, anyway.\u003C\u002Fp>",{"id":147,"html":148,"text":149,"type":150,"level":31},"b4","The obvious fix that didn&#39;t quite work","The obvious fix that didn't quite work","heading",{"id":152,"html":153,"type":139},"b5","\u003Cp>The original CSS was the usual \u003Ccode>::-webkit-scrollbar\u003C\u002Fcode> trio:\u003C\u002Fp>",{"id":155,"code":156,"type":157,"language":78,"highlight":158},"b6",".scroll-panel::-webkit-scrollbar {\n  width: 8px;\n}\n.scroll-panel::-webkit-scrollbar-thumb {\n  background: #8b8f98;\n  border-radius: 999px;\n}\n.scroll-panel::-webkit-scrollbar-track {\n  background: transparent;\n}","code",[],{"id":160,"html":161,"type":139},"b7","\u003Cp>A quick search turns up the &quot;real&quot; fix: add \u003Ccode>scrollbar-width\u003C\u002Fcode> and \u003Ccode>scrollbar-color\u003C\u002Fcode>, the standards-track properties, and Firefox will fall in line.\u003C\u002Fp>",{"id":163,"code":164,"type":157,"language":78,"highlight":165},"b8",".scroll-panel {\n  scrollbar-width: thin;\n  scrollbar-color: #8b8f98 transparent; \u002F* thumb, track *\u002F\n}",[],{"id":167,"html":168,"type":139},"b9","\u003Cp>Added, shipped, closed the ticket. Then the designer opened Firefox and asked why the thumb was square again, and why hovering it didn&#39;t darken like it did in Chrome.\u003C\u002Fp>",{"id":170,"html":171,"type":139},"b10","\u003Cp>Those aren&#39;t bugs. They&#39;re the entire API. \u003Ccode>scrollbar-color\u003C\u002Fcode> takes exactly two colors — thumb, then track — and \u003Ccode>scrollbar-width\u003C\u002Fcode> takes one of three keywords: \u003Ccode>auto\u003C\u002Fcode>, \u003Ccode>thin\u003C\u002Fcode>, \u003Ccode>none\u003C\u002Fcode>. No \u003Ccode>border-radius\u003C\u002Fcode>. No \u003Ccode>:hover\u003C\u002Fcode>. No pixel widths. The standard model was never going to reproduce the webkit one, because it isn&#39;t trying to.\u003C\u002Fp>",{"id":173,"html":174,"text":174,"type":150,"level":31},"b11","Two different scrollbars, not one API with a Firefox bug",{"id":176,"html":177,"type":139},"b12","\u003Cp>\u003Ccode>::-webkit-scrollbar\u003C\u002Fcode> and its siblings (\u003Ccode>::-webkit-scrollbar-thumb\u003C\u002Fcode>, \u003Ccode>::-webkit-scrollbar-track\u003C\u002Fcode>) aren&#39;t in any CSS spec. They&#39;re a WebKit invention from the 2010s that Blink inherited when Chrome forked from WebKit — which is exactly why they work in Chrome, Edge, Opera, and Safari (all WebKit- or Blink-rendered) and nowhere else. Firefox runs Gecko, and Gecko&#39;s maintainers rejected general support for them as a matter of policy, on the record: letting authors reach in and restyle an OS-level UI affordance with arbitrary CSS was the thing they objected to. The one exception is a narrow, Mozilla-curated webcompat shim for a short list of specific sites with broken nested scroll containers — not something your own site can opt into, and it doesn&#39;t change what \u003Ccode>@supports selector(::-webkit-scrollbar)\u003C\u002Fcode> reports anywhere else.\u003C\u002Fp>",{"id":179,"html":180,"type":139},"b13","\u003Cp>What Gecko shipped instead, back in Firefox 64 (late 2018), was the \u003Cstrong>CSS Scrollbars Module\u003C\u002Fstrong>: \u003Ccode>scrollbar-color\u003C\u002Fcode> and \u003Ccode>scrollbar-width\u003C\u002Fcode>. Deliberately coarse — two colors and a width keyword — because the point was letting a page hint at a color scheme without letting it fully take over a native control the OS and accessibility tooling still need to reason about.\u003C\u002Fp>",{"id":182,"html":183,"type":139},"b14","\u003Cp>For five years that was a genuine split: Firefox had the standard properties, every other engine had the non-standard pseudo-elements, and &quot;support both&quot; meant literally writing both and hoping. Chrome and Edge didn&#39;t add either standard property until version 121, in January 2024. Safari shipped the pair in two steps: \u003Ccode>scrollbar-width\u003C\u002Fcode> landed quietly in Safari 18.2, December 2024 — then \u003Ccode>scrollbar-color\u003C\u002Fcode>, the harder half of the pair, held out a full year longer, only landing in Safari 26.2, released December 2025.\u003C\u002Fp>",{"id":185,"html":186,"type":139},"b15","\u003Cp>That&#39;s not a typo for &quot;last year.&quot; As of right now, this is the first point in the standard&#39;s history where \u003Cstrong>every current engine\u003C\u002Fstrong> — Gecko, Blink, and WebKit — understands \u003Ccode>scrollbar-color\u003C\u002Fcode> and \u003Ccode>scrollbar-width\u003C\u002Fcode> at the same time. \u003Ca href=\"https:\u002F\u002Fweb-platform-dx.github.io\u002Fweb-features-explorer\u002Ffeatures\u002Fscrollbar-color\">web-features\u003C\u002Fa> tags it Baseline &quot;newly available&quot; as of December 2025, not &quot;widely available&quot; yet (that&#39;s dated out to 2028, for the usual two-more-years-of-safety reason Baseline uses) — but for a page that doesn&#39;t need to support scrollbars on browsers from before this winter, it&#39;s already a one-line, no-prefix, every-engine fix.\u003C\u002Fp>",{"id":188,"html":189,"type":139},"b16","\u003C!-- playground:start -->",{"id":191,"html":192,"text":192,"type":150,"level":31},"b17","🎮 Try it yourself",{"id":194,"html":195,"type":139},"b18","\u003Cp>\u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-color-native-scrollbar-styling\u002Fplayground\">▶️ Open the interactive playground →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":197,"html":198,"type":139},"b19","\u003Cp>\u003Cem>Runs right in your browser — poke at it and watch the concept react live.\u003C\u002Fem>\u003C\u002Fp>",{"id":200,"html":201,"type":139},"b20","\u003C!-- playground:end -->",{"id":203,"html":204,"text":205,"type":150,"level":31},"b21","The fix: there&#39;s no &quot;layer both&quot; anymore","The fix: there's no \"layer both\" anymore",{"id":207,"html":208,"type":139},"b22","\u003Cp>The obvious next move is to try to get the best of both: keep the \u003Ccode>::-webkit-scrollbar\u003C\u002Fcode> trio for pixel control, add \u003Ccode>scrollbar-color\u003C\u002Fcode>\u002F\u003Ccode>scrollbar-width\u003C\u002Fcode> for Firefox, and gate the webkit rules behind a feature query so each engine only sees what it understands:\u003C\u002Fp>",{"id":210,"code":211,"type":157,"language":78,"highlight":212},"b23",".scroll-panel {\n  scrollbar-color: #8b8f98 transparent; \u002F* thumb, track *\u002F\n  scrollbar-width: thin;\n}\n\n@supports selector(::-webkit-scrollbar) {\n  .scroll-panel::-webkit-scrollbar {\n    width: 8px;\n  }\n  .scroll-panel::-webkit-scrollbar-thumb {\n    background: #8b8f98;\n    border-radius: 999px;\n  }\n}",[],{"id":214,"html":215,"type":139},"b24","\u003Cp>That doesn&#39;t do what it looks like it does, not anymore. \u003Ccode>@supports selector(::-webkit-scrollbar)\u003C\u002Fcode> really does just ask &quot;do you parse this selector&quot; — and in Chrome, Edge, and Safari the answer is still \u003Ccode>true\u003C\u002Fcode>, they still recognize the syntax. But recognizing a selector and rendering its declarations turned out to be two different things. Starting with Chrome 121, Chromium made a deliberate call: if an element&#39;s \u003Ccode>scrollbar-width\u003C\u002Fcode> or \u003Ccode>scrollbar-color\u003C\u002Fcode> is set to anything other than its initial value, that element&#39;s \u003Ccode>::-webkit-scrollbar*\u003C\u002Fcode> rules are ignored outright, no matter what the cascade says. WebKit matched the same behavior for Safari once \u003Ccode>scrollbar-color\u003C\u002Fcode> shipped there (\u003Ca href=\"https:\u002F\u002Fbugs.webkit.org\u002Fshow_bug.cgi?id=257617\">WebKit bug 257617\u003C\u002Fa>, resolved fixed). So the moment \u003Ccode>.scroll-panel\u003C\u002Fcode> has \u003Ccode>scrollbar-color\u003C\u002Fcode> on it, the \u003Ccode>border-radius\u003C\u002Fcode> rule below it is dead code in every current engine — true in Firefox for the obvious reason, true in Chrome, Edge, and Safari for this one.\u003C\u002Fp>",{"id":217,"code":218,"type":157,"language":78,"highlight":219},"b25","\u002F* This is the entire fix, today. There's nothing to layer on top of it. *\u002F\n.scroll-panel {\n  scrollbar-color: #8b8f98 transparent; \u002F* thumb, track *\u002F\n  scrollbar-width: thin;\n}",[],{"id":221,"html":222,"type":139},"b26","\u003Cp>That&#39;s not a bug costing you a workaround — it&#39;s four engines agreeing, on purpose, that a page which opts into the standard model doesn&#39;t get to keep one foot in the proprietary one. Note what this gives you: not &quot;Firefox now looks identical to Chrome,&quot; but &quot;every engine renders something you chose, instead of three doing that and one doing whatever its 1995 default is.&quot; That&#39;s a lower bar than the webkit pseudo-elements on purpose — a scrollbar is still a native control, and \u003Ccode>forced-colors\u003C\u002Fcode> mode and accessibility tooling get to keep overriding your two colors when a user needs them to.\u003C\u002Fp>",{"id":224,"html":225,"text":226,"type":150,"level":31},"b27","Where this still doesn&#39;t save you","Where this still doesn't save you",{"id":228,"html":229,"type":139},"b28","\u003Cp>If a design genuinely needs a scrollbar thinner than \u003Ccode>thin\u003C\u002Fcode>, a gradient thumb, or a hover state that visibly changes, the standard properties won&#39;t get you there in any engine, and now there&#39;s a sharper catch: that pixel-level version only renders at all if you leave \u003Ccode>scrollbar-color\u003C\u002Fcode>\u002F\u003Ccode>scrollbar-width\u003C\u002Fcode> off that element completely. Add either one back — even \u003Ccode>scrollbar-width: auto\u003C\u002Fcode> — and the webkit rules you were relying on go dark again, in Chrome and Safari too. So it&#39;s a straight either\u002For, not a fallback chain: pixel-perfect in Chromium and WebKit with zero styling in Firefox, or one coarse look in all four engines. Don&#39;t promise a client cross-browser pixel parity on a custom scrollbar; promise one of those two things, not both at once on the same element.\u003C\u002Fp>",{"id":231,"html":232,"type":139},"b29","\u003C!-- quiz:start -->",{"id":234,"html":235,"text":235,"type":150,"level":31},"b30","🧠 Test yourself",{"id":237,"html":238,"type":139},"b31","\u003Cp>Think it clicked? \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-color-native-scrollbar-styling\u002Fquiz\">Take the 7-question quiz →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":240,"html":241,"type":139},"b32","\u003Cp>\u003Cem>Instant feedback, a hint on every question, and an explanation for each answer — right or wrong.\u003C\u002Fem>\u003C\u002Fp>",{"id":243,"html":244,"type":139},"b33","\u003C!-- quiz:end -->",{"id":246,"html":247,"type":139},"b34","\u003Cp>The ticket didn&#39;t close because Firefox caught up to Chrome. It closed because the CSS finally asked each engine the question it could actually answer. Have you got a scrollbar hack in production you haven&#39;t opened in Firefox lately? Go check — I&#39;ll bet it&#39;s not the first corner that non-standard CSS cut without telling you.\u003C\u002Fp>",{"id":249,"html":250,"type":139},"b35","\u003C!-- related:start -->",{"id":252,"html":253,"text":253,"type":150,"level":31},"b36","📚 Read next",{"id":255,"type":256,"items":257,"ordered":18},"b37","list",[258,259,260],"\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-gutter-layout-shift\">I Deleted My Scroll-Lock Library&#39;s Ugly Hack. \u003Ccode>scrollbar-gutter\u003C\u002Fcode> Replaces It.\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-relative-color-syntax\">Stop Hardcoding Color Variants. Relative Color Syntax Does It.\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-color-scheme-native-dark-mode-form-controls\">The CSS Property That Fixes Dark Mode&#39;s Ugly White Boxes\u003C\u002Fa>",{"id":262,"html":263,"type":139},"b38","\u003C!-- related:end -->",{"id":265,"type":266},"b39","divider",{"id":268,"html":269,"type":139},"b40","\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":271,"html":272,"type":139},"b41","\u003Cp>\u003Cem>Thanks for reading! Let&#39;s stay connected:\u003C\u002Fem>\u003C\u002Fp>",{"id":274,"type":256,"items":275,"ordered":18},"b42",[276,277,278],"⭐ \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>","The Figma handoff said \"thin gray scrollbar, rounded thumb, matches the rest of the UI.\" Twenty minutes and one Stack Overflow answer later, it did — in Chrome. The PR screenshot looked exactly like the design. It shipped.\n\nThree days later: \"scrollbars look broken in Firefox.\" Not styled-wrong broken. *Default-Windows-95 broken* — the fat gray bar with square ends, like the CSS had never been written at all.\n\nIt hadn't been. Not in Firefox, anyway.\n\n## The obvious fix that didn't quite work\n\nThe original CSS was the usual `::-webkit-scrollbar` trio:\n\n```css\n.scroll-panel::-webkit-scrollbar {\n  width: 8px;\n}\n.scroll-panel::-webkit-scrollbar-thumb {\n  background: #8b8f98;\n  border-radius: 999px;\n}\n.scroll-panel::-webkit-scrollbar-track {\n  background: transparent;\n}\n```\n\nA quick search turns up the \"real\" fix: add `scrollbar-width` and `scrollbar-color`, the standards-track properties, and Firefox will fall in line.\n\n```css\n.scroll-panel {\n  scrollbar-width: thin;\n  scrollbar-color: #8b8f98 transparent; \u002F* thumb, track *\u002F\n}\n```\n\nAdded, shipped, closed the ticket. Then the designer opened Firefox and asked why the thumb was square again, and why hovering it didn't darken like it did in Chrome.\n\nThose aren't bugs. They're the entire API. `scrollbar-color` takes exactly two colors — thumb, then track — and `scrollbar-width` takes one of three keywords: `auto`, `thin`, `none`. No `border-radius`. No `:hover`. No pixel widths. The standard model was never going to reproduce the webkit one, because it isn't trying to.\n\n## Two different scrollbars, not one API with a Firefox bug\n\n`::-webkit-scrollbar` and its siblings (`::-webkit-scrollbar-thumb`, `::-webkit-scrollbar-track`) aren't in any CSS spec. They're a WebKit invention from the 2010s that Blink inherited when Chrome forked from WebKit — which is exactly why they work in Chrome, Edge, Opera, and Safari (all WebKit- or Blink-rendered) and nowhere else. Firefox runs Gecko, and Gecko's maintainers rejected general support for them as a matter of policy, on the record: letting authors reach in and restyle an OS-level UI affordance with arbitrary CSS was the thing they objected to. The one exception is a narrow, Mozilla-curated webcompat shim for a short list of specific sites with broken nested scroll containers — not something your own site can opt into, and it doesn't change what `@supports selector(::-webkit-scrollbar)` reports anywhere else.\n\nWhat Gecko shipped instead, back in Firefox 64 (late 2018), was the **CSS Scrollbars Module**: `scrollbar-color` and `scrollbar-width`. Deliberately coarse — two colors and a width keyword — because the point was letting a page hint at a color scheme without letting it fully take over a native control the OS and accessibility tooling still need to reason about.\n\nFor five years that was a genuine split: Firefox had the standard properties, every other engine had the non-standard pseudo-elements, and \"support both\" meant literally writing both and hoping. Chrome and Edge didn't add either standard property until version 121, in January 2024. Safari shipped the pair in two steps: `scrollbar-width` landed quietly in Safari 18.2, December 2024 — then `scrollbar-color`, the harder half of the pair, held out a full year longer, only landing in Safari 26.2, released December 2025.\n\nThat's not a typo for \"last year.\" As of right now, this is the first point in the standard's history where **every current engine** — Gecko, Blink, and WebKit — understands `scrollbar-color` and `scrollbar-width` at the same time. [web-features](https:\u002F\u002Fweb-platform-dx.github.io\u002Fweb-features-explorer\u002Ffeatures\u002Fscrollbar-color) tags it Baseline \"newly available\" as of December 2025, not \"widely available\" yet (that's dated out to 2028, for the usual two-more-years-of-safety reason Baseline uses) — but for a page that doesn't need to support scrollbars on browsers from before this winter, it's already a one-line, no-prefix, every-engine fix.\n\n\u003C!-- playground:start -->\n\n## 🎮 Try it yourself\n\n**[▶️ Open the interactive playground →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-color-native-scrollbar-styling\u002Fplayground)**\n\n_Runs right in your browser — poke at it and watch the concept react live._\n\n\u003C!-- playground:end -->\n\n## The fix: there's no \"layer both\" anymore\n\nThe obvious next move is to try to get the best of both: keep the `::-webkit-scrollbar` trio for pixel control, add `scrollbar-color`\u002F`scrollbar-width` for Firefox, and gate the webkit rules behind a feature query so each engine only sees what it understands:\n\n```css\n.scroll-panel {\n  scrollbar-color: #8b8f98 transparent; \u002F* thumb, track *\u002F\n  scrollbar-width: thin;\n}\n\n@supports selector(::-webkit-scrollbar) {\n  .scroll-panel::-webkit-scrollbar {\n    width: 8px;\n  }\n  .scroll-panel::-webkit-scrollbar-thumb {\n    background: #8b8f98;\n    border-radius: 999px;\n  }\n}\n```\n\nThat doesn't do what it looks like it does, not anymore. `@supports selector(::-webkit-scrollbar)` really does just ask \"do you parse this selector\" — and in Chrome, Edge, and Safari the answer is still `true`, they still recognize the syntax. But recognizing a selector and rendering its declarations turned out to be two different things. Starting with Chrome 121, Chromium made a deliberate call: if an element's `scrollbar-width` or `scrollbar-color` is set to anything other than its initial value, that element's `::-webkit-scrollbar*` rules are ignored outright, no matter what the cascade says. WebKit matched the same behavior for Safari once `scrollbar-color` shipped there ([WebKit bug 257617](https:\u002F\u002Fbugs.webkit.org\u002Fshow_bug.cgi?id=257617), resolved fixed). So the moment `.scroll-panel` has `scrollbar-color` on it, the `border-radius` rule below it is dead code in every current engine — true in Firefox for the obvious reason, true in Chrome, Edge, and Safari for this one.\n\n```css\n\u002F* This is the entire fix, today. There's nothing to layer on top of it. *\u002F\n.scroll-panel {\n  scrollbar-color: #8b8f98 transparent; \u002F* thumb, track *\u002F\n  scrollbar-width: thin;\n}\n```\n\nThat's not a bug costing you a workaround — it's four engines agreeing, on purpose, that a page which opts into the standard model doesn't get to keep one foot in the proprietary one. Note what this gives you: not \"Firefox now looks identical to Chrome,\" but \"every engine renders something you chose, instead of three doing that and one doing whatever its 1995 default is.\" That's a lower bar than the webkit pseudo-elements on purpose — a scrollbar is still a native control, and `forced-colors` mode and accessibility tooling get to keep overriding your two colors when a user needs them to.\n\n## Where this still doesn't save you\n\nIf a design genuinely needs a scrollbar thinner than `thin`, a gradient thumb, or a hover state that visibly changes, the standard properties won't get you there in any engine, and now there's a sharper catch: that pixel-level version only renders at all if you leave `scrollbar-color`\u002F`scrollbar-width` off that element completely. Add either one back — even `scrollbar-width: auto` — and the webkit rules you were relying on go dark again, in Chrome and Safari too. So it's a straight either\u002For, not a fallback chain: pixel-perfect in Chromium and WebKit with zero styling in Firefox, or one coarse look in all four engines. Don't promise a client cross-browser pixel parity on a custom scrollbar; promise one of those two things, not both at once on the same element.\n\n\u003C!-- quiz:start -->\n\n## 🧠 Test yourself\n\nThink it clicked? **[Take the 7-question quiz →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-color-native-scrollbar-styling\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\nThe ticket didn't close because Firefox caught up to Chrome. It closed because the CSS finally asked each engine the question it could actually answer. Have you got a scrollbar hack in production you haven't opened in Firefox lately? Go check — I'll bet it's not the first corner that non-standard CSS cut without telling you.\n\n\u003C!-- related:start -->\n\n## 📚 Read next\n\n- [I Deleted My Scroll-Lock Library's Ugly Hack. `scrollbar-gutter` Replaces It.](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-gutter-layout-shift)\n- [Stop Hardcoding Color Variants. Relative Color Syntax Does It.](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-relative-color-syntax)\n- [The CSS Property That Fixes Dark Mode's Ugly White Boxes](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fcss-color-scheme-native-dark-mode-form-controls)\n\n\u003C!-- related: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":111,"canonical":281,"description":282},"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fscrollbar-color-native-scrollbar-styling","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 U","01a1df1b-24b4-759b-be78-54de119038e1",{"id":285,"locked":18},"01a1df1b-24d5-722b-b511-9991c5df15fe",[287],{"id":45,"slug":46,"title":48,"_count":288},{"questions":51},[290],{"locale":13,"slug":46},{"id":45,"slug":46,"title":48,"_count":292,"questionCount":51},{"questions":51},[]]