Skip to content

Commit ddcea6d

Browse files
committed
[css-forms-1] Add pseudo-elements for slider-like controls.
Fixes #4410
1 parent aaf3fe2 commit ddcea6d

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

css-forms-1/Overview.bs

+59-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Abstract: This document is currently a loosely-structured set of ideas and inspi
1212
Warning: not ready
1313
</pre>
1414

15-
# New Pseudo-Elements # {#pseudos}
15+
# Pseudo-Elements # {#pseudo-elements}
1616

1717
This section defines some pseudo-elements for styling parts of form elements.
1818

@@ -79,6 +79,64 @@ This section defines some pseudo-elements for styling parts of form elements.
7979
element</a>, preceding any boxes generated by the ''::before''
8080
pseudo-element, with content as specified by 'content'.
8181

82+
## Styling parts of [=slider-like controls=]: the ''::slider-thumb'', ''::slider-track'', ''::slider-fill'' and ''::slider-options-track'' pseudo-elements ## {#slider-pseudos}
83+
84+
<dfn>Slider-like controls</dfn> are form controls that represent progress.
85+
That progress may be adjustable by the user.
86+
87+
The list of [=slider-like controls=] depends on the host language. For HTML, this corresponds to:
88+
89+
- ''&lt;progress>''
90+
- ''&lt;meter>''
91+
- ''&lt;input>'' elements with `type="range"`
92+
- ''&lt;input>'' elements with `type="checkbox" switch`
93+
94+
95+
The following pseudo-elements are provided to style their different parts:
96+
97+
<dl export>
98+
<dt><dfn>::slider-thumb</dfn>
99+
<dd>
100+
The ''::slider-thumb'' pseudo-element represents
101+
the portion that allows the user to adjust the progress of the control.
102+
103+
That portion may be omitted for controls where the progress is not adjustable.
104+
Disabled controls should provide this portion if the enabled state allows adjusting the progress.
105+
106+
NOTE: It is typically natively rendered as a circle in most user agents.
107+
108+
<dt><dfn>::slider-track</dfn>
109+
<dd>
110+
The ''::slider-track'' pseudo-element represents the portion containing
111+
both the progressed and unprogressed portions of the control.
112+
113+
<dt><dfn>::slider-fill</dfn>
114+
<dd>
115+
The ''::slider-fill'' pseudo-element represents
116+
the portion containing the progressed portion of the control.
117+
118+
When the progress of control is undetermined (like with ''&ltprogress indeterminate>''),
119+
the user agent is expected to give this portion an inline-size of zero.
120+
121+
<dt><dfn>::slider-options-track</dfn>
122+
<dd>
123+
The ''::slider-options-track'' pseudo-element represents the portion containing
124+
the options. It is expected to render at the same width as ''::slider-track''
125+
and underneath it in the block direction.
126+
127+
With `appearance: auto`, the user agent may draw tickmarks
128+
corresponding to the options given by the associated `<datalist>`.
129+
</dl>
130+
131+
These pseudo-elements are [=tree-abiding pseudo-elements=] and their structure is expected to be the following:
132+
133+
```
134+
<input type="range">
135+
├─ ::slider-track
136+
│ └─ ::slider-fill
137+
├─ ::slider-thumb
138+
└─ ::slider-options-track
139+
```
82140

83141
<h2 class="no-num non-normative" id="changes">Appendix: Explorations</h2>
84142

0 commit comments

Comments
 (0)