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 'scroll-snap-padding' property defines the area of the viewport
326
-
that is used as the <a>alignment container</a>
327
-
when aligning <a>scroll snap areas</a> to a <a>snap position</a>.
331
+
The 'scroll-snap-padding' property defines the <dfn local-lt="snap target area">scroll snap target area</dfn>--
332
+
the area of the viewport that is used as the <a>alignment container</a>
333
+
when aligning a <a>scroll snap area</a> to a <a>snap position</a>.
328
334
Values are interpreted as for 'padding',
329
-
and specify inward offsets from each side.
335
+
and specify inward offsets from each side of the viewport.
336
+
337
+
<div class="example">
338
+
In this example, points of interest in a map are centered
339
+
within the portion of the viewport that does not include the toolbar overlay.
340
+
341
+
<pre>
342
+
map {
343
+
overflow: scroll;
344
+
scroll-snap-type: proximity;
345
+
scroll-snap-padding: 3em 0 0 0;
346
+
}
347
+
toolbar {
348
+
position: absolute;
349
+
margin: 0.5em;
350
+
top: 0; left: 0; right: 0;
351
+
height: 2em;
352
+
}
353
+
city {
354
+
scroll-snap-align: center;
355
+
}
356
+
</pre>
357
+
</div>
330
358
331
-
Issue: Add illustration.
359
+
<div class="example">
332
360
333
361
Coordinate-based Snapping {#snap-points}
334
362
=========================
@@ -370,13 +398,16 @@ Scroll Snapping Coordinates: the 'scroll-snap-points-x' and 'scroll-snap-points-
370
398
and clamp the computed value to that minimum.
371
399
</dl>
372
400
373
-
Issue: We changed the initial value to make it so that the start and end of the scrollable area are always reachable and snappable.
401
+
Coordinates specified by 'scroll-snap-points-x' and 'scroll-snap-points-y'
402
+
are not affected by 'scroll-snap-padding'/'scroll-snap-destination'.
374
403
375
404
Issue: Should we add ''start-edge'' and ''end-edge'' keywords here, so that the start and end of the scrollable area can be defined as reachable?
376
405
This would be good for e.g. maps. (See <a href="https://lists.w3.org/Archives/Public/www-style/2015Jul/0453.html">Matt Rakow's take</a> on not having ''start'' or ''end'' here.)
377
406
378
407
Issue: It was <a href="https://lists.w3.org/Archives/Public/www-style/2015Jul/0453.html">suggested</a> that repeat() be mutually exclusive with element-based snap positions. Is there a better way to integrate this than having the initial value here be "elements"?
379
408
409
+
Issue: This needs logical equivalents (-block/-inline instead of -x/-y).
0 commit comments