-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathOverview.bs
More file actions
147 lines (118 loc) · 6.66 KB
/
Overview.bs
File metadata and controls
147 lines (118 loc) · 6.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<pre class='metadata'>
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/
Repository: https://github.com/w3c/csswg-drafts/tree/master/css-scrollbars-1 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
</pre>
<h2 id="intro">
Introduction</h2>
Note: this specification is
<a href="https://github.com/w3c/csswg-drafts/tree/master/css-scrollbars-1">
maintained in the W3C csswg-drafts GitHub repository as css-scrollbars-1
</a>.
<h3 id="scope">
Scope</h3>
<em>This subsection is non-normative.</em>
This module adds color properties for styling the scrollbar (if any) of an element per
<a href="https://www.w3.org/wiki/Css-scrollbars#Use-cases">documented use-cases</a>,
and as has been increasingly adopted
on the web since Windows IE 5.5 introduced it in 2000.
[Note: Add citations of examples from Bugzilla 77790 and webcompat].
Should we add scrollbar width? (<a href="https://github.com/w3c/csswg-drafts/issues/1958">Issue 1958</a>)
Out of scope:
<a href="https://www.w3.org/wiki/Css-scrollbars#Why_not_pseudos">pseudo-elements for selecting specific parts of a scrollbar are unnecesssary</a>
for the documented use-cases and are thus out of scope for this specification.
<h3 id="values">
Values</h3>
This specification follows the
<a href="https://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> 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 <a>CSS-wide keywords</a> keywords as their property value.
For readability they have not been repeated explicitly.
<h2 id="scrollbar-color-properties">
Scrollbar Color Properties</h2>
<pre class="propdef">
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: auto | <<color>>
Initial: auto
Inherited: yes
Computed value: the computed color or the keyword auto
Animation type: <a href="https://www.w3.org/TR/css3-transitions/#animtype-color">color</a>
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>]
Percentages: n/a
Media: visual
</pre>
These properties allow the author to set colors for various aspects of an element’s scrollbars.
Note: Per <a href="https://github.com/w3c/csswg-drafts/issues/1960">Issue 1960</a>,
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 <a href="https://www.w3.org/wiki/Css-scrollbars#Use-cases">research so far</a>,
and preferably only two of those. Additional input, data, suggestions welcome at those links!
UAs must apply the scrollbar-* values set on the root element to the viewport.
Note: Unlike 'overflow' (and overflow-*) properties,
scrollbar-* values set on the HTML body element are not propagated to viewport.
<dl dfn-type="value" dfn-for="scrollbar-base-color">
<dt><dfn>auto</dfn>
<dd>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.
<dt><dfn><<color>></dfn>
<dd>apply the color to that portion of the scrollbar, and potentially other portions of the scrollbar.
</dl>
Details:
If scrollbar-track-color computes to auto, and scrollbar-face-color and scrollbar-highlight-color are not auto,
they are combined (e.g. dithered) to color the scrollbar track.
If just one of scrollbar-face-color and scrollbar-highlight-color is not auto, it is used to color the scrollbar track.
If scrollbar-face-color computes to auto and scrollbar-base-color is not auto,
then use its value for scrollbar-face-color.
If scrollbar-3dlight-color computes to auto and scrollbar-base-color is not auto,
then use its value for scrollbar-3dlight-color.
If an element has both horizontal and vertical scrollbars, and the scrollbar-face-color is not auto,
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.
(Note: add diagram showing the different named pieces - something like
<a href="http://www.howtocreate.co.uk/tutorials/scrlbar.html">http://www.howtocreate.co.uk/tutorials/scrlbar.html</a>)
(Note: add 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 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 <a href="https://github.com/w3c/csswg-drafts/issues/1956">Issue 1956</a>.
<div class="example">
<p>The following example
(as noted in
<a href="https://www.w3.org/Style/Examples/007/scrollbars.en.html">https://www.w3.org/Style/Examples/007/scrollbars.en.html</a>)
resets scrollbar colors in IE.</p>
<pre><code class="css">
<!-- -->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;
<!-- -->}</code></pre>
</div>