Skip to content

Commit 8e3b1cc

Browse files
committed
[css-scroll-snap-2] Cleanup of markup/grammars, tiny bit of detail filled in
1 parent a57db33 commit 8e3b1cc

File tree

1 file changed

+42
-35
lines changed

1 file changed

+42
-35
lines changed

css-scroll-snap-2/Overview.bs

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -47,62 +47,69 @@ Setting Where Scroll Starts {#properties-on-the-scroll-container}
4747
The 'scroll-start' property {#scroll-start}
4848
-------------------------------------------
4949

50-
<pre class="propdef">
50+
<pre class="propdef shorthand">
5151
Name: scroll-start
52-
Value: auto | [end | center] | <<length-percentage>>
53-
Initial: none
54-
Applies to: all elements
55-
Inherited: no
56-
Percentages: n/a
57-
Computed value: specified keyword(s)
58-
Animation type: discrete
52+
Value: [ auto | start | end | center | <<length-percentage>> ]{1,2}
5953
</pre>
6054

61-
This property is a shorthand property that sets all of the scroll-start-* longhands in one declaration. It does not work like 'margin', where a value is repeated to all sides. {{scroll-start: 200px}} is not {{scroll-start: 200px 200px}}, it's {{scroll-start: 200px 0}}. Inline is first, followed by block.
55+
This property is a shorthand property that sets all of the scroll-start-* longhands in one declaration.
56+
The first value defines the scroll starting point in the block axis,
57+
the second sets it in the inline axis.
58+
If the second value is omitted, it defaults to ''scroll-start/start''.
6259

63-
Values are defined as follows:
60+
Values are defined as follows:
6461

65-
<dl dfn-type=value dfn-for="scroll-snap-type">
66-
<dt><dfn>end</dfn>
62+
<dl dfn-type=value dfn-for="scroll-start, scroll-start-x, scroll-start-y, scroll-start-block, scroll-start-inline">
63+
<dt><dfn>auto</dfn>
6764
<dd>
68-
Scroll position starts at the end of a <a>scroll container</a>.
69-
Property value is at risk, may be duplicative.
65+
...
7066

67+
<dt><dfn><<length-percentage>></dfn>
68+
<dd>
69+
...
70+
71+
Negative values are invalid.
72+
Values corresponding to a length greater than the width/height of the scrollport
73+
are valid,
74+
but clamped to the width/height of the scrollport.
75+
76+
<dt><dfn>start</dfn>
7177
<dt><dfn>center</dfn>
78+
<dt><dfn>end</dfn>
7279
<dd>
73-
Scroll position starts at the middle of a <a>scroll container</a>.
74-
Property value is at risk, may be duplicative.
80+
Equivalent to ''0%'', ''50%'', and ''100%'', respectively.
7581
</dl>
7682

7783
Styling Snapped Items {#todo}
7884
=============================
7985

80-
The Snapped-element Pseudo-class: ':snapped' {#snapped}
86+
The Snapped-element Pseudo-class: '':snapped'' {#snapped}
8187
-------------------------------------------------------
8288

83-
The {{:snapped}} pseudo-class matches any scroll snap
84-
targets, regardless of axis. The longform physical and logical pseudo-class
85-
selectors allow for more finite snapped children styling
89+
The <dfn selector>:snapped</dfn> pseudo-class matches any scroll snap targets,
90+
regardless of axis.
91+
The longform physical and logical pseudo-class selectors
92+
allow for more finite snapped children styling
8693
as they can target an individual axis.
8794

8895
More specific options are defined as follows:
8996

90-
<dl dfn-type=value dfn-for="scroll-snap-type">
97+
<dl dfn-type=selector>
9198
<dt><dfn>:snapped-x</dfn>
9299
<dd>
93-
Matches the child snapped on the {{x}} axis.
100+
Matches the child snapped on the horizontal axis.
94101

95102
<dt><dfn>:snapped-y</dfn>
96103
<dd>
97-
Matches the child snapped on the {{y}} axis.
104+
Matches the child snapped on the vertical axis.
98105

99106
<dt><dfn>:snapped-inline</dfn>
100107
<dd>
101-
Matches the child snapped on the {{inline}} axis.
108+
Matches the child snapped on the [=inline=] axis.
102109

103110
<dt><dfn>:snapped-block</dfn>
104111
<dd>
105-
Matches the child snapped on the {{block}} axis.
112+
Matches the child snapped on the [=block=] axis.
106113
</dl>
107114

108115
Snap Events {#todo}
@@ -118,8 +125,8 @@ Snap Events {#todo}
118125
████████ ███ ████████ ██ ██ ██ ██████
119126
-->
120127

121-
'snapChanged' and 'snapChanging'
122-
--------------------------------
128+
{{snapChanged}} and {{snapChanging}} {#todo}
129+
--------------------------------------------
123130

124131
CSS scroll snap points are often used as a mechanism to
125132
create scroll interactive "selection" components,
@@ -135,10 +142,10 @@ Snap Events {#todo}
135142
<th>Event handler event type
136143
<tbody>
137144
<tr>
138-
<th>{{snapChanged}}
145+
<th><dfn event>snapChanged</dfn>
139146
<td>{{scroll!!event}}
140147
<tr>
141-
<th>{{snapChanging}}
148+
<th><dfn event>snapChanging</dfn>
142149
<td>{{scroll!!event}}
143150
</table>
144151

@@ -163,29 +170,29 @@ Physical Longhands for 'scroll-start' {#scroll-start-longhands-physical}
163170

164171
<pre class="propdef">
165172
Name: scroll-start-x, scroll-start-y
166-
Value: auto | [end | center] | <<length-percentage>>
173+
Value: auto | start | end | center | <<length-percentage>>
167174
Initial: auto
168175
Applies to: <a>scroll containers</a>
169176
Inherited: no
170-
Percentages: relative to the scroll container’s scrollport
177+
Percentages: relative to the corresponding axis of the scroll container’s scrollport
171178
Computed value: the keyword ''scroll-start/auto'' or a computed <<length-percentage>> value
172179
Animation type: by computed value type
173180
</pre>
174181

175-
Negative values are invalid.
182+
...
176183

177184
Flow-relative Longhands for 'scroll-start' {#scroll-start-longhands-logical}
178185
--------------------------------------------------------------------------
179186

180187
<pre class="propdef">
181188
Name: scroll-start-inline, scroll-start-block
182-
Value: auto | [end | center] | <<length-percentage>>
189+
Value: auto | start | end | center | <<length-percentage>>
183190
Initial: auto
184191
Applies to: <a>scroll containers</a>
185192
Inherited: no
186-
Percentages: relative to the scroll container’s scrollport
193+
Percentages: relative to the corresponding axis of the scroll container’s scrollport
187194
Computed value: the keyword ''scroll-start/auto'' or a computed <<length-percentage>> value
188195
Animation type: by computed value type
189196
</pre>
190197

191-
Negative values are invalid.
198+
...

0 commit comments

Comments
 (0)