The scrollbar-color property sets the color of a scrollbar’s thumb (the moving piece) and track (the background groove).
Apply it to a scrolling box — typically one with overflow: auto or scroll. On the root element (html) it styles the viewport scrollbar. The property is inherited. The initial value is auto.
Baseline 2025 · Newly available.
Not deprecated. Cross-browser support is recent (Safari joined in late 2025). Treat custom colors as progressive enhancement; keep usable defaults when unsupported.
Syntax
CSS Syntax
syntax.css
scrollbar-color:auto | <color> <color>;
Example: scrollbar-color: #2563eb #e2e8f0; — first color = thumb, second = track.
Theme the box. Dark background sets the context for the scrollbar.
Match the bar. Light thumb on a darker track keeps the control readable.
Check contrast. Thumb and track should not blend into each other.
Progressive. Unsupported browsers keep their default scrollbar.
Edge Cases & Pitfalls
If the scrollbar looks wrong or unchanged, one of these is usually why.
order
Thumb first, track second
Two colors are required. Swapping them paints the groove with the thumb color.
webkit
Non-auto disables ::-webkit-scrollbar
A non-auto value (including an inherited one) makes browsers ignore WebKit scrollbar pseudo-elements on that element.
overlay
Overlay scrollbars hide the track
On some OS settings the track is transparent until you hover the scrollbar. Thumb color still applies.
root
Viewport needs html, not only body
Root styles apply to the viewport. A body-only rule does not propagate there.
a11y
Forced colors may reset you
In forced-colors mode, user agents set scrollbar-color to auto so system contrast wins.
Compatibility
Browser Support
scrollbar-color is a browser CSS property for scroll containers. Node.js, Deno, and Bun do not apply it.
✓ Baseline 2025 · Newly available
scrollbar-color
Chrome 121+, Edge 121+, Firefox 64+, Safari 26.2+ / iOS 26.2+. Not supported in Internet Explorer.
88%Global support
Google Chrome121+
Full support
Mozilla Firefox64+
Full support
Apple Safari26.2+
Full support
Microsoft Edge121+
Full support
Opera107+
Full support
Samsung Internet25+
Full support
Internet ExplorerNo support
No support
scrollbar-colorNewly available
Bottom line: Use as progressive enhancement. Older Safari and Chrome need a fallback or accept the default scrollbar. This is not a JavaScript runtime API.
Remember
Key Takeaways
Role: color the scrollbar thumb (first) and track (second), or use auto.
Inherited. Put it on the scrolling box (or html for the page).
Standard path for themed bars; non-auto turns off WebKit scrollbar pseudos.
Newly available. Keep contrast high; treat styling as progressive enhancement.
One line:scrollbar-color: thumb track themes the bar without WebKit-only CSS.
Frequently Asked Questions
It sets the colors of a scrollbar’s thumb (the draggable piece) and track (the groove behind it). Use two colors: first thumb, then track. Or use auto for the platform default.
The initial value is auto, which lets the browser and operating system choose the colors.
On a scrolling box — for example a div with overflow: auto or overflow: scroll. On the root (html) it styles the viewport scrollbar. A body-only rule does not apply to the viewport.
When scrollbar-color is anything other than auto, browsers ignore the non-standard ::-webkit-scrollbar family on that element (and on descendants that inherit the non-auto value).
Yes. A non-auto value on a parent can color scrollbars on nested scrollers unless they set their own value.
It is Baseline Newly available (2025): Chrome 121+, Edge 121+, Firefox 64+, Safari 26.2+. It is a browser CSS property, not a Node.js feature. Internet Explorer does not support it.