The scrollbar-colorCSS property sets the color of the scrollbar track and thumb.
The track refers to the background of the scrollbar, which is generally fixed regardless of the scrolling position.
The thumb refers to the moving part of the scrollbar, which usually floats on top of the track.
When scrollbar-color value is set on the document's root element, the values are applied to the viewport scrollbars.
Syntax
css
/* Keyword values */scrollbar-color: auto;/* <color> values */scrollbar-color: rebeccapurple green;/* Two valid colors.
The first applies to the thumb of the scrollbar, the second to the track. *//* Global values */scrollbar-color: inherit;scrollbar-color: initial;scrollbar-color: revert;scrollbar-color: revert-layer;scrollbar-color: unset;
When using scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. For keyword values, UAs should ensure the colors they use have enough contrast. See Techniques for WCAG 2.0: G183: Using a contrast ratio of 3:1.