You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The layout of the scroll container’s contents in the example.
84
+
The snapport is represented by the red rectangle, and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is “center” in the inline (horizontal) axis, a snap position is established at each scroll position which aligns the X-center of the snapport (represented by a red dotted line) with the X-center of a snap area (represented by a yellow dotted line).
85
+
</figcaption>
86
+
</figure> -->
87
+
</div>
88
+
89
+
<div class="example">
90
+
A search bar is available when the user scrolls back to the top:
The layout of the scroll container’s contents in the example.
118
+
The snapport is represented by the red rectangle, and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is “center” in the inline (horizontal) axis, a snap position is established at each scroll position which aligns the X-center of the snapport (represented by a red dotted line) with the X-center of a snap area (represented by a yellow dotted line).
119
+
</figcaption>
120
+
</figure> -->
121
+
</div>
41
122
42
123
Setting Where Scroll Starts {#properties-on-the-scroll-container}
@@ -54,8 +135,7 @@ The 'scroll-start' property {#scroll-start}
54
135
55
136
This property is a shorthand property that sets all of the scroll-start-* longhands in one declaration.
56
137
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''.
138
+
the second sets it in the inline axis. If the second value is omitted, it defaults to ''scroll-start/start''. If ''scroll-start-target'' is set on any child, ''scroll-start'' is not used, in favor of using the element as the offset.
59
139
60
140
Values are defined as follows:
61
141
@@ -80,6 +160,30 @@ The 'scroll-start' property {#scroll-start}
80
160
Equivalent to ''0%'', ''50%'', and ''100%'', respectively.
81
161
</dl>
82
162
163
+
The 'scroll-start-target' property {#scroll-start-target}
164
+
-------------------------------------------
165
+
166
+
<pre class="propdef shorthand">
167
+
Name: scroll-start-target
168
+
Value: [ none | auto ]
169
+
</pre>
170
+
171
+
This property is a shorthand property that sets all of the scroll-start-target-* longhands in one declaration.
172
+
The first value defines the scroll starting point in the block axis,
173
+
the second sets it in the inline axis.
174
+
If the second value is omitted, it defaults to ''none''.
<dd>Element is used to calculate the ''scroll-start'' position,
183
+
taking into account ''scroll-padding''
184
+
as if the element was a ''scroll-snap'' target.
185
+
</dl>
186
+
83
187
Styling Snapped Items {#todo}
84
188
=============================
85
189
@@ -149,6 +253,53 @@ Snap Events {#todo}
149
253
<td>{{scroll!!event}}
150
254
</table>
151
255
256
+
<!-- BIG TEXT: INTERACTIONS -->
257
+
258
+
Interactions with:
259
+
==================
260
+
261
+
The next sections outline interactions with other specs and scroll position effecting scenarios.
262
+
263
+
''scroll-padding'' and ''scroll-margin''
264
+
----------------------------------------
265
+
266
+
If the scrollport has a in-page '':target'' via a URL fragment or a previous scroll position, then ''scroll-start'' is unused. Existing target logic should go unchanged. This makes ''scroll-start'' a soft request in the scroll position resolution routines.
267
+
268
+
''fragment navigation''
269
+
-----------------------
270
+
271
+
If the scrollport has a in-page '':target'' via a URL fragment or a previous scroll position, then ''scroll-start'' is unused. Existing target logic should go unchanged. This makes ''scroll-start'' a soft request in the scroll position resolution routines.
272
+
273
+
''scrollTo()'' options
274
+
----------------------
275
+
276
+
TODO
277
+
278
+
a ''scroll-snap'' container with only 1 snap child
This effectively will layout and start scroll at the snapped child, thus negating / cancelling ''scroll-start''. ''scroll-start'' will only work if nothing else has effected the scroll position.
282
+
283
+
nested scrollers
284
+
----------------
285
+
286
+
Should follow patterns that scroll snap has set.
287
+
288
+
''display'' is toggled
289
+
----------------------
290
+
291
+
Same behavior that animations follow with ''first layout''.
292
+
293
+
RTL/LTR
294
+
-------
295
+
296
+
Logical properties are offered for length offsets that should be flow relative. Furthermore, the ''end'' and ''start'' keywords are always logical.
0 commit comments