|
| 1 | +<pre class='metadata'> |
| 2 | +Title: CSS Scrollbars Module Level 1 |
| 3 | +Group: csswg |
| 4 | +Shortname: css-scrollbars |
| 5 | +Level: 1 |
| 6 | +Status: ED |
| 7 | +Work Status: Exploring |
| 8 | +ED: https://drafts.csswg.org/css-scrollbars/ |
| 9 | +Editor: Tantek Çelik, Mozilla, http://tantek.com/contact |
| 10 | +Editor: Rossen Atanassov, Microsoft, ratan@microsoft.com |
| 11 | +Abstract: CSS Scrollbars standardizes the ability to color scrollbars introduced in 2000 by WindowsIE5.5. This is useful when building web applications which use color schemes very different from the appearance of default platform scrollbars. |
| 12 | +Link Defaults: css-color-3 (property) color |
| 13 | +</pre> |
| 14 | + |
| 15 | +<h2 id="intro"> |
| 16 | +Introduction</h2> |
| 17 | + |
| 18 | +<em>This subsection is non-normative.</em> |
| 19 | + |
| 20 | +This module adds properties for styling the scrollbar (if any) of an element as has been increasingly adopted |
| 21 | +on the web since Windows IE 5.5 introduced it in 2000. [add citations of examples from Bugzilla 77790 and webcompat]. |
| 22 | + |
| 23 | +<h3 id="values"> |
| 24 | +Values</h3> |
| 25 | + |
| 26 | + This specification follows the |
| 27 | + <a href="https://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> from [[!CSS2]]. |
| 28 | + Value types not defined in this specification are defined in CSS Values & Units [[!CSS-VALUES-3]]. |
| 29 | + Other CSS modules may expand the definitions of these value types. |
| 30 | + |
| 31 | + In addition to the property-specific values listed in their definitions, |
| 32 | + all properties defined in this specification |
| 33 | + also accept the <a>CSS-wide keywords</a> keywords as their property value. |
| 34 | + For readability they have not been repeated explicitly. |
| 35 | + |
| 36 | +<h2 id="scrollbar-color-properties"> |
| 37 | +Scrollbar Color Properties</h2> |
| 38 | + |
| 39 | +<pre class="propdef"> |
| 40 | +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 |
| 41 | +Value: normal | <<color>> |
| 42 | +Initial: normal |
| 43 | +Inherited: no |
| 44 | +Computed value: the computed color or the keyword normal |
| 45 | +Animation type: <a href="https://www.w3.org/TR/css3-transitions/#animtype-color">color</a> |
| 46 | +Applies to: block containers and boxes that establish a formatting context [same as elements that <a href=https://www.w3.org/TR/CSS22/visufx.html#propdef-overflow">'overflow' applies to</a>] |
| 47 | +Percentages: n/a |
| 48 | +Media: visual |
| 49 | +</pre> |
| 50 | + |
| 51 | +These properties allow the author to set colors for various aspects of a scrollbar. |
| 52 | + |
| 53 | +<dl dfn-type="value" dfn-for="scrollbar-3dlight-color"> |
| 54 | +<dt><dfn>normal</dfn> |
| 55 | +<dd>default platform rendering for that portion of the scrollbar, in the absence of any other |
| 56 | +related scrollbar color properties. See details below for which scrollbar color are related to which. |
| 57 | +<dt><dfn><<color>></dfn> |
| 58 | +<dd>apply the color to that portion of the scrollbar, and potentially other portions of the scrollbar. |
| 59 | +</dl> |
| 60 | + |
| 61 | +Details: |
| 62 | + |
| 63 | +If scrollbar-track-color computes to normal, and scrollbar-face-color and scrollbar-highlight-color are not normal, |
| 64 | +they are combined (e.g. dithered) to color the scrollbar track. |
| 65 | +If just one of scrollbar-face-color and scrollbar-highlight-color is not normal, it is used to color the scrollbar track. |
| 66 | + |
| 67 | +If scrollbar-face-color computes to normal and scrollbar-base-color is not normal, |
| 68 | +then use its value for scrollbar-face-color. |
| 69 | + |
| 70 | +If scrollbar-3dlight-color computes to normal and scrollbar-base-color is not normal, |
| 71 | +then use its value for scrollbar-3dlight-color. |
| 72 | + |
| 73 | +If an element has both horizontal and vertical scrollbars, and the scrollbar-face-color is not normal, |
| 74 | +use it for the area in the corner between the two scrollbars. |
| 75 | + |
| 76 | +If the color of any part of the scrollbar is specified, |
| 77 | +implementations may render a simpler scrollbar than the default platform UI rendering, and color it accordingly. |
| 78 | + |
| 79 | +(diagram showing the different named pieces - something like http://www.howtocreate.co.uk/tutorials/scrlbar.html) |
| 80 | + |
| 81 | +(example of an overflow element with colorized scrollbars to match page styling, |
| 82 | +PNG of the same in a browser that supports it currently) |
| 83 | + |
| 84 | +Implementations may ignore any scrollbar part color properties for scrollbar parts that do not exist |
| 85 | +on the underlying platform. |
| 86 | + |
| 87 | +Note: when a user interacts with a scrollbar (e.g. arrow buttons or scroll thumb if any), |
| 88 | +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. |
| 89 | + |
| 90 | +Issue: IE uses named System Colors as defaults for each of the scrollbar color properties, equivalent to: |
| 91 | + |
| 92 | + <div class="example"> |
| 93 | + <p>The following example |
| 94 | + (as noted in https://www.w3.org/Style/Examples/007/scrollbars.en.html) |
| 95 | + resets scrollbar colors in IE.</p> |
| 96 | + |
| 97 | + <pre><code class="css"> |
| 98 | +<!-- -->html { |
| 99 | +<!-- --> scrollbar-face-color: ThreeDFace; |
| 100 | +<!-- --> scrollbar-shadow-color: ThreeDDarkShadow; |
| 101 | +<!-- --> scrollbar-highlight-color: ThreeDHighlight; |
| 102 | +<!-- --> scrollbar-3dlight-color: ThreeDLightShadow; |
| 103 | +<!-- --> scrollbar-darkshadow-color: ThreeDDarkShadow; |
| 104 | +<!-- --> scrollbar-track-color: Scrollbar; |
| 105 | +<!-- --> scrollbar-arrow-color: ButtonText; |
| 106 | +<!-- -->}</code></pre> |
| 107 | + </div> |
| 108 | + |
| 109 | +Should we use those literal value keywords as initial values for each property respectively instead of normal, |
| 110 | +or specify and accept both? |
| 111 | + |
| 112 | +Issue: Should inherited be "yes"? Specifying on the root affects all elements by default, but is that true at all levels? |
0 commit comments