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.
116
-
The snap alignment container 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 X axis, a snap position is established at each scroll offset which aligns the X-center of the snap alignment container (represented by a red dotted line) with the X-center of a snap area (represented by a yellow dotted line).
116
+
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 X axis, a snap position is established at each scroll offset 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).
The layout of the scroll container's contents in the example.
161
-
The snap alignment container is represented by the red rectangle (inset from the top by 100px due to the scroll-snap-padding), and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "start" in the Y axis, a snap position is established at each scroll offset which aligns the Y-start of the snap alignment container (represented by a red dotted line) with the Y-start of a snap area (represented by a yellow dotted line).
161
+
The snapport is represented by the red rectangle (inset from the top by 100px due to the scroll-snap-padding), and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "start" in the Y axis, a snap position is established at each scroll offset which aligns the Y-start of the snapport (represented by a red dotted line) with the Y-start of a snap area (represented by a yellow dotted line).
162
162
</figcaption>
163
163
</figure>
164
164
</div>
@@ -187,8 +187,8 @@ Overview {#overview}
187
187
<a>Snap positions</a> can be specified
188
188
as a particular alignment ('scroll-snap-align')
189
189
of an element's <a>scroll snap area</a> ('scroll-snap-margin', defaulting to its border box)
190
-
within the <a>scroll container</a>’s <a>snap alignment container</a>
191
-
(its visual viewport, as reduced by its 'scroll-snap-padding').
190
+
within the <a>scroll container</a>’s <a>snapport</a>
191
+
(its scrollport, as reduced by its 'scroll-snap-padding').
192
192
This is conceptually equivalent to specifying the alignment of
193
193
an <a>alignment subject</a> within an <a>alignment container</a>.
194
194
A scroll position that satisfies the specified alignment
@@ -216,9 +216,9 @@ Definitions {#definitions}
216
216
<dd>
217
217
An element which provides a scrolling user interface as described in [[!CSS21]], particularly in the section on overflow.
218
218
219
-
<dt><dfn export>snap alignment container</dfn>
219
+
<dt><dfn export>snapport</dfn>
220
220
<dd>
221
-
A scroll container's snap alignment container is the rectangle obtained by reducing its visual viewport by its 'scroll-snap-padding'.
221
+
A scroll container's snapport is the rectangle obtained by reducing its scrollport by its 'scroll-snap-padding'.
For a scroll container, a particular value for its scroll offset is a snap position if when scrolled to that offset the visual viewport of the scroll container would align with a descendent element in the manner specified by the scroll snap properties.
231
+
For a scroll container, a particular value for its scroll offset is a snap position if when scrolled to that offset the scrollport of the scroll container would align with a descendent element in the manner specified by the scroll snap properties.
A scroll container is said to be snapped to a snap position if its visual viewport's scroll offset is that snap position and there is no active scrolling operation.
235
+
A scroll container is said to be snapped to a snap position if its scrollport's scroll offset is that snap position and there is no active scrolling operation.
Percentages: relative to the corresponding dimension of the scroll container's visual viewport
322
+
Percentages: relative to the corresponding dimension of the scroll container's scrollport
323
323
Media: interactive
324
324
Computed value: as specified, with lengths made absolute
325
325
Animatable: as length, percentage, or calc
326
326
</pre>
327
327
328
-
The 'scroll-snap-padding' property defines the <a>snap alignment container</a>, a region inset from the visual viewport of a <a>scroll container</a> used in calculating its <a>snap positions</a>. The snap alignment container is used as the alignment container when calculating <a>snap positions</a>. Values are interpreted as for 'padding', and specify inward offsets from each edge of the visual viewport.
328
+
The 'scroll-snap-padding' property defines the <dfn local-lt="snapport">scroll snapport</dfn>, a region inset from the scrollport of a <a>scroll container</a> used in calculating its <a>snap positions</a>. The snapport is used as the alignment container when calculating <a>snap positions</a>. Values are interpreted as for 'padding', and specify inward offsets from each edge of the scrollport.
329
329
330
330
<div class="example">
331
331
In this example, scroll-snap-padding is used to center slideshow images within the portion of the viewport that is not obscured by a fixed-position toolbar.
This property is a <a>shorthand property</a> that sets all of the <a href="#longhands"><css>scroll-snap-padding-*</css> longhands</a> in one declaration.
353
353
354
-
Properties on the elements {#properties-on-the-elements}
The 'scroll-snap-align' property specifies how an element's scroll snap area should align with its ancestor scroll container's snap alignment container. The two values specify the snapping behavior in the x and y axes, respectively. If only one value is specified, the second value defaults to the same value.
422
+
The 'scroll-snap-align' property specifies
423
+
the box's <a>snap position</a> as an alignment of
424
+
its <a>snap area</a> (as the <a>alignment subject</a>)
425
+
within its <a>snap container's</a><a>snapport</a> (as the <a>alignment container</a>). The two values specify the snapping behavior in the x and y axes, respectively. If only one value is specified, the second value defaults to the same value.
423
426
424
427
Issue: Should this be x/y axes, or inline/block? Starting with x/y axes for consistency with padding/area, otherwise a writing mode change would result in a axis mismatch (since padding is physical by default).
425
428
@@ -463,13 +466,13 @@ Physical Longhands for 'scroll-snap-padding' {#padding-longhands-physical}
463
466
Initial: 0
464
467
Applies to: <a>scroll containers</a>
465
468
Inherited: no
466
-
Percentages: relative to the scroll container's visual viewport
469
+
Percentages: relative to the scroll container's scrollport
467
470
Media: interactive
468
471
Computed value: as specified, with lengths made absolute
469
472
Animatable: as length, percentage, or calc
470
473
</pre>
471
474
472
-
These <a>longhands</a> of 'scroll-snap-padding' specify the top, right, bottom, and left edges of the <a>snap alignment container</a>, respectively.
475
+
These <a>longhands</a> of 'scroll-snap-padding' specify the top, right, bottom, and left edges of the <a>snapport</a>, respectively.
473
476
474
477
Flow-relative Longhands for 'scroll-snap-padding' {#padding-longhands-logical}
@@ -480,27 +483,27 @@ Flow-relative Longhands for 'scroll-snap-padding' {#padding-longhands-logical}
480
483
Initial: 0
481
484
Applies to: <a>scroll containers</a>
482
485
Inherited: no
483
-
Percentages: relative to the scroll container's visual viewport
486
+
Percentages: relative to the scroll container's scrollport
484
487
Media: interactive
485
488
Computed value: as specified, with lengths made absolute
486
489
Animatable: as length, percentage, or calc
487
490
</pre>
488
491
489
-
These <a>longhands</a> of 'scroll-snap-padding' specify the block-start, inline-start, block-end, and inline-end edges of the <a>snap alignment container</a>, respectively.
492
+
These <a>longhands</a> of 'scroll-snap-padding' specify the block-start, inline-start, block-end, and inline-end edges of the <a>snapport</a>, respectively.
Percentages: relative to the scroll container's visual viewport
500
+
Percentages: relative to the scroll container's scrollport
498
501
Media: interactive
499
502
Computed value: as specified, with lengths made absolute
500
503
Animatable: as length, percentage, or calc
501
504
</pre>
502
505
503
-
These <a>shorthands</a> of 'scroll-snap-padding-block-start' + 'scroll-snap-padding-block-end' and 'scroll-snap-padding-inline-start' + 'scroll-snap-padding-inline-end' are <a>longhands</a> of 'scroll-snap-padding', and specify the block-axis and inline-axis edges of the <a>snap alignment container</a>, respectively.
506
+
These <a>shorthands</a> of 'scroll-snap-padding-block-start' + 'scroll-snap-padding-block-end' and 'scroll-snap-padding-inline-start' + 'scroll-snap-padding-inline-end' are <a>longhands</a> of 'scroll-snap-padding', and specify the block-axis and inline-axis edges of the <a>snapport</a>, respectively.
504
507
505
508
If two values are specified, the first gives the start value and the second gives the end value.
0 commit comments