CSS scrollbar-color Property
Description
The scrollbar-color CSS property controls the colors used to paint the browser’s scrollbars for elements that are rendered with stylable scrollbars. It affects the visible parts of a scrollbar such as the draggable thumb and the track it moves in, allowing the scrollbar to be visually aligned with the surrounding UI or page theme. Because it targets the scrollbar as a UI component, it’s useful when you want scroll controls to feel like a coherent part of your design rather than an unstyled system element.
In practical use, scrollbar-color is often applied to match scrollbars to a brand palette, to create subtle or high‑contrast scroll indicators, or to make scrollbars more visible on complex backgrounds. When designing with it, consider how the chosen colors interact with the content beneath the track, and how the thumb color reads against the track — contrast and clarity are important for usability. It can be combined with dynamic design techniques (for example using CSS custom properties) so scrollbar colors respond to theme changes or user interactions without needing additional markup.
The property interacts with other layout and UI-related properties and system behaviors. For example, thickness and layout implications of scrollbars are influenced by scrollbar-width, and the perceived result depends on the page and element backgrounds, which you control with background-color. Additionally, user agent and system-level settings — including color schemes and accessibility modes — can override or alter the final rendering; authors should consider the page’s color-handling intent (for example via color-scheme) and provide designs that remain usable when platform styles take precedence.
As a guideline, use scrollbar-color to enhance clarity and cohesion of scrollable interfaces, but test across different themes and user settings to ensure legibility and accessibility. If the platform or user settings block custom styling of scrollbars, fall back to designs that remain functional with default scrollbars so content remains easily navigable.
Definition
- Initial value
- auto
- Applies to
- scrolling boxes
- Inherited
- yes
- Computed value
- as specified
- Animatable
- by computed value type
- JavaScript syntax
- object.style.scrollbarColor
Syntax
scrollbar-color: auto | <color>{2}
Values
- autoDefault platform rendering for the track portion of the scrollbar, in the absence of any other related scrollbar color properties.
- <color>{2}Applies the first color to the scrollbar thumb, the second to the scrollbar track.
Example
Browser Support
The following information will show you the current browser support for the CSS scrollbar-color property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
