From 2a19902d69470e63f823dcd30631e0281757d4be Mon Sep 17 00:00:00 2001
From: Matt Rakow
Open issue on whether to enhance the scroll-snap-type property for specifying the axis or adding a second property. We have resolved that this functionality be added once the issue is resolved.
From 16cbf5297be89352a4cf4f25b226fedde7a43990 Mon Sep 17 00:00:00 2001
From: Matt Rakow The scroll-snap-type property defines how strictly a scroll container’s visual viewport should rest on snap positions. It intentionally does not specify nor mandate any precise animations or physics used to enforce those snap position; this is left up to the user agent. The scroll-snap-type property defines how strictly a scroll container’s visual viewport should rest on snap positions. It intentionally does not specify nor mandate any precise animations or physics used to enforce those snap positions; this is left up to the user agent. Open issue on whether to enhance the scroll-snap-type property for specifying the axis or adding a second property. We have resolved that this functionality be added once the issue is resolved. If the content changes such that the visual viewport would no longer rest on a snap position (e.g. content is added, moved, deleted, resized), the scroll offset must be modified to maintain alignment of the visual viewport with a snap position. If the visual viewport was already aligned with a snap position prior to the content change and that snap position still exists (e.g. its associated element was not deleted), that same snap position must be satisfied after the content change. If the content changes such that the visual viewport would no longer rest on a snap position (e.g. content is added, moved, deleted, resized), the scroll offset may be modified to maintain alignment of the visual viewport with a snap position. If the visual viewport was already aligned with a snap position prior to the content change and that snap position still exists (e.g. its associated element was not deleted) and if the user agent elects to modify the scroll offset to maintain snap position alignment, that same snap position should be satisfied after the content change. The scroll-snap-padding property defines the snap alignment container, a region inset from the visual viewport of a scroll container used in calculating its snap positions. The snap alignment container is used as the alignment container when calculating valid snap positions.
+
img {
/* Specifies that the center of each photo
should align with the center of the scroll
@@ -83,7 +83,7 @@ Ignored Terms: scroll-snap-positions-*, containing block chain
}
-
+
<div class="photoGallery">
<img src="img1.jpg">
<img src="img2.jpg">
@@ -110,7 +110,7 @@ Ignored Terms: scroll-snap-positions-*, containing block chain
to snap one page at a time). However, if a scrolling operation would finish near a snap position, then the scroll will be adjusted to
align the page as specified.
-
+
.page {
/* Defines the top of each page as the
edge that should be used for snapping */
@@ -129,7 +129,7 @@ Ignored Terms: scroll-snap-positions-*, containing block chain
}
-
+
<div class="docScroller">
<div class="page">Page 1</div>
<div class="page">Page 2</div>
From e6b198576c29cdeb3270d9bed3a146dbacb103a9 Mon Sep 17 00:00:00 2001
From: Matt Rakow
@@ -219,11 +219,15 @@ Ignored Terms: scroll-snap-positions-*, containing block chain
Scroll Snap Types: the 'scroll-snap-type' property
- The ''scroll-snap-type'' property defines how strictly a scroll container's visual viewport should rest on snap positions. It intentionally does not specify nor mandate any precise animations or physics used to enforce those snap position; this is left up to the user agent.
+ The ''scroll-snap-type'' property defines how strictly a scroll container's visual viewport should rest on snap positions. It intentionally does not specify nor mandate any precise animations or physics used to enforce those snap positions; this is left up to the user agent.
Scroll Snap Padding: the 'scroll-snap-padding' property
@@ -238,7 +242,7 @@ Ignored Terms: scroll-snap-positions-*, containing block chain
Inherited: no
Percentages: relative to the scroll container's visual viewport
Media: interactive
- Computed value: specified value, with lengths made absolute
+ Computed value: as specified, with lengths made absolute
Animatable: yes
@@ -262,7 +266,7 @@ Ignored Terms: scroll-snap-positions-*, containing block chain
Inherited: no
Percentages: relative to the specified element box
Media: interactive
- Computed value: specified value, with lengths made absolute
+ Computed value: as specified, with lengths made absolute
Animatable: yes
From c9ced672f314668db92a262adf4ecfad652543a7 Mon Sep 17 00:00:00 2001
From: Matt Rakow CSS Scroll Snap Points Module Level 1
- Editor’s Draft,
+ Editor’s Draft,
1.2
example [CSS3VAL], when combined with this module, expands the
definition of the <length> value type as used in this specification.
2. Motivating Examples
- img {
- /* Specifies that the center of each photo
- should align with the center of the scroll
- container in the X axis when snapping */
- scroll-snap-align: center none;
-}
-.photoGallery {
- width: 500px;
- overflow-x: auto;
- overflow-y: hidden;
- white-space: nowrap;
- /* Requires that the scroll offset always be
- at a valid snap position when the scrolling
- operation completes. */
- scroll-snap-type: mandatory;
-}
-
-<div class="photoGallery">
- <img src="img1.jpg">
- <img src="img2.jpg">
- <img src="img3.jpg">
- <img src="img4.jpg">
- <img src="img5.jpg">
-</div>
-
+img {
+ /* Specifies that the center of each photo
+ should align with the center of the scroll
+ container in the X axis when snapping */
+ scroll-snap-align: center none;
+}
+.photoGallery {
+ width: 500px;
+ overflow-x: auto;
+ overflow-y: hidden;
+ white-space: nowrap;
+ /* Requires that the scroll offset always be
+ at a valid snap position when the scrolling
+ operation completes. */
+ scroll-snap-type: mandatory;
+}
+<div class="photoGallery">
+ <img src="img1.jpg">
+ <img src="img2.jpg">
+ <img src="img3.jpg">
+ <img src="img4.jpg">
+ <img src="img5.jpg">
+</div>
.page {
- /* Defines the top of each page as the
- edge that should be used for snapping */
- scroll-snap-align: none start;
-}
-.docScroller {
- width: 500px;
- overflow-x: hidden;
- overflow-y: auto;
- /* Specifies that each element’s snap area should
- align with a 100px offset from the top edge. */
- scroll-snap-padding: 100px 0 0;
- /* Encourages scrolling to end at a snap position when the
- operation completes, if it is near a valid snap position */
- scroll-snap-type: proximity;
-}
-
-<div class="docScroller">
- <div class="page">Page 1</div>
- <div class="page">Page 2</div>
- <div class="page">Page 3</div>
- <div class="page">Page 4</div>
-</div>
-
+.page {
+ /* Defines the top of each page as the
+ edge that should be used for snapping */
+ scroll-snap-align: none start;
+}
+.docScroller {
+ width: 500px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ /* Specifies that each element’s snap area should
+ align with a 100px offset from the top edge. */
+ scroll-snap-padding: 100px 0 0;
+ /* Encourages scrolling to end at a snap position when the
+ operation completes, if it is near a valid snap position */
+ scroll-snap-type: proximity;
+}
+<div class="docScroller">
+ <div class="page">Page 1</div>
+ <div class="page">Page 2</div>
+ <div class="page">Page 3</div>
+ <div class="page">Page 4</div>
+</div>
5. Scroll Snap Types: the scroll-snap-type property
-
@@ -310,7 +364,7 @@
none
6. Scroll Snap Padding: the scroll-snap-padding property
interactive
Computed value:
- specified value, with lengths made absolute
+ as specified, with lengths made absolute
Animatable:
yes
@@ -387,7 +445,7 @@ Pro
n/a
interactive
no
- specified value
+ as specified
scroll-snap-padding
<length>{1,4}
@@ -638,7 +696,7 @@ Pro
relative to the scroll container’s visual viewport
interactive
yes
- specified value, with lengths made absolute
+ as specified, with lengths made absolute
scroll-snap-area
[ border-box | margin-box ]? <length>{1,4}
@@ -648,7 +706,7 @@ Pro
relative to the specified element box
interactive
yes
- specified value, with lengths made absolute
+ as specified, with lengths made absolute
scroll-snap-align
[ none | start | end | center ]{1,2}