Title: CSS Scrollbars Module Level 1
Group: csswg
Shortname: css-scrollbars
Level: 1
Status: ED
Work Status: Revising
ED: https://drafts.csswg.org/css-scrollbars/
Editor: Tantek Çelik, Mozilla https://www.mozilla.org/, http://tantek.com/contact, w3cid 1464
Editor: Rossen Atanassov, Microsoft, ratan@microsoft.com, w3cid 49885
Abstract: CSS Scrollbars standardizes the ability to color scrollbars introduced in 2000 by Windows IE 5.5. 
          This is useful when building web applications which use color schemes very different from 
          the appearance of default platform scrollbars.
Link Defaults: css-color-3 (property) color

Introduction

Scope

This subsection is non-normative. This module adds color properties for styling the scrollbar (if any) of an element as has been increasingly adopted on the web since Windows IE 5.5 introduced it in 2000. [add citations of examples from Bugzilla 77790 and webcompat]. Should we add scrollbar width? (Issue 1958)

Values

This specification follows the CSS property definition conventions from [[!CSS2]]. Value types not defined in this specification are defined in CSS Values & Units [[!CSS-VALUES-3]]. Other CSS modules may expand the definitions of these value types. In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the CSS-wide keywords keywords as their property value. For readability they have not been repeated explicitly.

Scrollbar Color Properties

Name: scrollbar-3dlight-color, 
      scrollbar-arrow-color,  
      scrollbar-base-color, 
      scrollbar-darkshadow-color, 
      scrollbar-face-color, 
      scrollbar-highlight-color, 
      scrollbar-track-color, 
      scrollbar-shadow-color
Value: normal | <>
Initial: normal
Inherited: yes
Computed value: the computed color or the keyword normal
Animation type: color
Applies to: block containers and boxes that establish a formatting context [same as elements that 'overflow' applies to]
Percentages: n/a
Media: visual
These properties allow the author to set colors for various aspects of a scrollbar. Note: Per Issue 1960, the list of scrollbar-*-color properties is likely to be reduced to 2-3 (ideally 2), with current candidates being scrollbar-base-color, scrollbar-face-color, scrollbar-track-color, per research so far, and preferably only two of those. Additional input, data, suggestions welcome at those links!
normal
default platform rendering for that portion of the scrollbar, in the absence of any other related scrollbar color properties. See details below for which scrollbar color are related to which.
<>
apply the color to that portion of the scrollbar, and potentially other portions of the scrollbar.
Details: If scrollbar-track-color computes to normal, and scrollbar-face-color and scrollbar-highlight-color are not normal, they are combined (e.g. dithered) to color the scrollbar track. If just one of scrollbar-face-color and scrollbar-highlight-color is not normal, it is used to color the scrollbar track. If scrollbar-face-color computes to normal and scrollbar-base-color is not normal, then use its value for scrollbar-face-color. If scrollbar-3dlight-color computes to normal and scrollbar-base-color is not normal, then use its value for scrollbar-3dlight-color. If an element has both horizontal and vertical scrollbars, and the scrollbar-face-color is not normal, use it for the area in the corner between the two scrollbars. If the color of any part of the scrollbar is specified, implementations may render a simpler scrollbar than the default platform UI rendering, and color it accordingly. (diagram showing the different named pieces - something like http://www.howtocreate.co.uk/tutorials/scrlbar.html) (example of an overflow element with colorized scrollbars to match page styling, PNG of the same in a browser that supports it currently) Implementations may ignore any scrollbar part color properties for scrollbar parts that do not exist on the underlying platform. Note: when a user interacts with a scrollbar (e.g. arrow buttons or scroll thumb if any), implementations may alter which scrollbar colors apply to which scrollbar parts (e.g. replace 3dlight and darkshadow colors with their shadow color, and highlight and shadow colors with their face color. Note: IE uses named System Colors as defaults for each of the scrollbar color properties. See related Issue 1956.

The following example (as noted in https://www.w3.org/Style/Examples/007/scrollbars.en.html) resets scrollbar colors in IE.


html { 
    scrollbar-face-color: ThreeDFace;
    scrollbar-shadow-color: ThreeDDarkShadow;
    scrollbar-highlight-color: ThreeDHighlight;
    scrollbar-3dlight-color: ThreeDLightShadow;
    scrollbar-darkshadow-color: ThreeDDarkShadow;
    scrollbar-track-color: Scrollbar;
    scrollbar-arrow-color: ButtonText;
}