CSSApr 3, 2026 ยท Updated Oct 13, 2026 ยท 3 min read

How to Customize Scrollbar Styles with CSS

Default browser scrollbars are functional but visually inconsistent and often clash with custom-designed interfaces โ€” especially dark-themed ones. CSS lets you customize scrollbar width, colors, and shape to match your design. Two approaches cover all modern browsers.

๐Ÿ“œ
Try the Scrollbar Styler
Free, no signup
โ†’
DG
Derek Giordano
Designer & Developer
In this guide
01The Standard Properties (Now in Every Major Engine)02The ::-webkit-scrollbar Pseudo-elements03Combining Them: the Rule That Changed in Chrome 12104Hiding Scrollbars (While Keeping Scroll)

The Standard Properties (Now in Every Major Engine)

CSS Scrollbars Level 1 defines two properties: scrollbar-width (auto, thin or none) and scrollbar-color (thumb color, then track color). Firefox has supported them since version 64; Chrome and Edge added them in version 121 (January 2024) and Safari in 26.2 (December 2025), per MDN's compatibility data checked October 13, 2026.

.panel { scrollbar-width: thin; scrollbar-color: #5A6178 #0B0D17; /* thumb, track */ }

The ::-webkit-scrollbar Pseudo-elements

The older, non-standard ::-webkit-scrollbar family still works in Chromium and Safari and gives finer control โ€” exact pixel width, rounded thumbs, hover states:

::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: #0B0D17; } ::-webkit-scrollbar-thumb { background: #5A6178; border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #7A8199; }

Combining Them: the Rule That Changed in Chrome 121

The usual "cross-browser" advice is to set both. Since Chrome 121, that silently drops your WebKit styling: when scrollbar-width or scrollbar-color applies to an element, Chromium ignores ::-webkit-scrollbar for it. We measured the rendered scrollbar width in Chromium 141 (headed, classic scrollbars, script in our test folder):

CSS on the scroll containerScrollbar width
Nothing (browser default)15 px
::-webkit-scrollbar { width: 20px } only20 px
scrollbar-width: thin only10 px
Both together (the common snippet)10 px โ€” the 20px WebKit rule was ignored

So choose per element. If the standard properties are enough, use only them. If you want the WebKit look where it is available and the standard properties elsewhere, put the standard ones behind a feature query that excludes browsers which also support ::-webkit-scrollbar, or accept the standard look everywhere โ€” the simplest option now that all engines support it.

Whichever you choose, keep the thumb visible. A very common dark-theme pair, thumb #1A1D2E on track #0B0D17, has a contrast ratio of just 1.16:1; the #5A6178 thumb above gives 3.15:1 against the same track, enough to find it at a glance.

Hiding Scrollbars (While Keeping Scroll)

To hide scrollbars but keep the content scrollable:

.no-scrollbar { scrollbar-width: none; } /* Firefox */
.no-scrollbar::-webkit-scrollbar { display: none; } /* Chrome */

Use this sparingly โ€” hidden scrollbars remove a visual affordance that tells users the content is scrollable. It works best for horizontal carousels and custom scroll containers where alternative navigation is provided.

Frequently Asked Questions

How do I change scrollbar color in CSS?+
Use the standard property scrollbar-color: thumb color then track color, for example scrollbar-color: #5A6178 #0B0D17. It works in Firefox 64+, Chrome and Edge 121+ and Safari 26.2+. The older ::-webkit-scrollbar-thumb and ::-webkit-scrollbar-track pseudo-elements still work in Chromium and Safari, but Chromium ignores them on any element where scrollbar-color or scrollbar-width applies.
Can I hide scrollbars with CSS?+
Yes. scrollbar-width: none (Firefox) and ::-webkit-scrollbar { display: none } (Chrome/Safari) hide scrollbars while keeping content scrollable. Use with caution โ€” it removes a scroll affordance.
Are custom scrollbars accessible?+
Custom-styled scrollbars are functional and accessible as long as they remain visible and have sufficient contrast. Avoid hiding scrollbars entirely unless alternative scroll indicators are provided.
Try it yourself

Use the Scrollbar Styler โ€” free, no signup required.

โšก Open Scrollbar Styler
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.