The scrollbar-color property lets you customize scrollbar thumb and track colors on scrollable elements for a more polished, on-brand look.
01
thumb
Draggable.
02
track
Background.
03
auto
Default.
04
colors
Two values.
05
overflow
Scroll box.
06
width
Pair with it.
Fundamentals
Introduction
The scrollbar-color property in CSS is a convenient way to customize the color of scrollbars in a web page.
It lets you specify the thumb and track colors, which helps scrollable areas feel more consistent with your site branding and overall design.
Definition and Usage
Apply scrollbar-color to elements that scroll — such as a content panel, sidebar, or card with overflow: auto or overflow: scroll.
The first color value styles the thumb. The second color value styles the track behind it.
💡
Beginner Tip
Try scrollbar-color: blue lightgray; on a scrollable div. The thumb becomes blue and the track becomes light gray in browsers that support the property.
Foundation
📝 Syntax
The syntax for the scrollbar-color property is simple. You specify two colors: one for the thumb and one for the track.
Dark mode themes — Use darker thumb and track colors in night-themed layouts.
Simple theming — Avoid long WebKit pseudo-element rules when standard colors are enough.
Use it on the scrolling element itself. For more advanced styling in unsupported browsers, you may still need ::-webkit-scrollbar rules.
Preview
👀 Live Preview
Scroll inside the box below. It uses scrollbar-color: #2563eb #e2e8f0.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam imperdiet est et risus convallis, ut accumsan magna tincidunt. Integer pulvinar dui non nisi elementum, a scelerisque nisl fermentum. Cras venenatis sem at velit auctor, nec lacinia lectus sodales. Duis convallis mi eu facilisis tristique.
In supporting browsers, the scrollbar thumb appears blue and the track appears light gray.
Hands-On
Examples Gallery
Start with the reference blue and light gray scrollbar, try brand hex colors, then explore dark theme and thin scrollbar styling.
📜 Custom Scrollbar Colors
Style scrollbar thumb and track colors on scrollable elements — matching the reference example.
Example 1 — Blue thumb and light gray track
In this example, we’ll change the scrollbar colors of a div element to have a blue thumb and a light gray track.
The scrollbar becomes thinner while keeping custom green thumb and track colors.
How It Works
Color and width are separate properties, but they work well together for lightweight panel designs.
Companion
scrollbar-color in the family
scrollbar-color styles the thumb and track on scrollable elements. Pair it with scrollbar-width when you also want a thinner or hidden scrollbar, and use overflow: auto or overflow: scroll so the element can actually scroll.
Apply overflow: auto or overflow: scroll so the browser shows a scrollbar when content overflows.
Overflow
2
You set two colors
Use scrollbar-color: thumb track; — the first color paints the draggable thumb, the second paints the track behind it.
CSS rule
3
Browser renders the scrollbar
In supporting browsers, the native scrollbar uses your colors. Use auto to fall back to the operating system defaults.
Rendering
=
🎨
Themed scrollbars
Scrollable panels, sidebars, and content boxes match your site palette without custom scrollbar pseudo-elements.
Compatibility
Browser Compatibility
The scrollbar-color property is well supported in Firefox and in Chromium browsers (Chrome, Edge, Opera) from version 121 onward. Safari support is still limited, especially on iOS where scrollbars are often overlay-style and may not show custom colors. Test scrollable panels in the browsers your audience uses.
✓ Scrollbar styling · Modern support
Reliable in Firefox and Chromium
Firefox has supported scrollbar-color since version 64. Chrome, Edge, and Opera added support in 121+. Safari remains partial.
88%Modern browser support
Google Chrome121+ · Desktop & Android
Full support
Mozilla Firefox64+ · Desktop & Mobile
Full support
Apple SafariLimited · macOS & iOS
Partial support
Microsoft Edge121+ · Chromium
Full support
Opera107+ · Modern versions
Full support
Testing tip
Scroll a tall panel in Firefox and Chrome to confirm thumb and track colors. On iOS Safari, scrollbars may stay hidden until scrolling and may ignore custom colors.
scrollbar-color property88% supported
Bottom line: Treat scrollbar-color as progressive enhancement. Unsupported browsers keep default scrollbars and scrolling still works normally.
Wrap Up
Conclusion
The scrollbar-color property provides a simple way to customize the appearance of scrollbars, allowing you to create a more cohesive and visually appealing design.
By experimenting with different thumb and track colors, you can ensure that every aspect of your website matches your design vision. Keep browser compatibility in mind so your custom scrollbars are effective across the platforms your users rely on.
Apply scrollbar-color on elements that actually scroll with overflow: auto or scroll
Use enough contrast between thumb and track colors
Match scrollbar colors to your light or dark theme
Pair with scrollbar-width: thin for compact panels
Test in Firefox and Chrome where support is strongest
❌ Don’t
Expect custom colors on every mobile browser — iOS often uses overlay scrollbars
Use colors so similar that the thumb disappears into the track
Forget that the first color is the thumb and the second is the track
Replace working scrollbars with non-scrollable overflow just for styling
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about scrollbar-color
Use these points when styling scrollable panels and sidebars.
5
Core concepts
★01
auto Default
Browser picks colors.
Default
⚙02
Thumb + Track
Two color values.
Syntax
◉03
Scrollable box
Needs overflow.
Target
▦04
Firefox & Chrome
Best support.
Browsers
🔄05
scrollbar-width
Pair for size.
Companion
❓ Frequently Asked Questions
scrollbar-color sets the colors of a scrollbar thumb and track on scrollable elements. The first color is the thumb and the second color is the track.
The thumb is the draggable part of the scrollbar. The track is the background groove behind the thumb.
The default value is auto, which lets the browser and operating system choose the scrollbar colors.
Apply it to elements that scroll, such as divs, sections, or sidebars with overflow set to auto or scroll.
Use it when you want scrollbars to match your site theme without writing full WebKit scrollbar pseudo-element styles. Pair it with scrollbar-width when you also want to change scrollbar size.