diff --git a/scroll-animations-1/Overview.bs b/scroll-animations-1/Overview.bs index 3b7ae00a785..4498bf44a95 100755 --- a/scroll-animations-1/Overview.bs +++ b/scroll-animations-1/Overview.bs @@ -666,7 +666,7 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) { }); const slideIn = target.animate({ - transform: ['translateX(0)',q 'translateX(50vw)'], + transform: ['translateX(0)', 'translateX(50vw)'], opacity: [0, 1] }, { timeline:timeline, @@ -676,6 +676,37 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) { } +The same logic can be done in CSS markup: +
+@media (prefers-reduced-motion: no-preference) {
+
+  @keyframes slide-in {
+    from {
+      transform: translateX(0);
+      opacity: 0;
+    }
+
+    to {
+      transform: translateX(50vw);
+      opacity: 1;
+    }
+  }
+
+  @scroll-timeline image-in-scrollport {
+    source: selector(#container);
+    start: selector(#image) end;
+    end: selector(#image) start;
+  }
+
+  #target {
+    animation-name: slide-in;
+    animation-duration: 1s;
+    animation-timeline: image-in-scrollport;
+  }
+
+}
+
+ @@ -843,7 +874,7 @@ Issue(5167): This will likely change in the future.
   Name: source
   For: @scroll-timeline
-  Value: selector(<>) | auto | none
+  Value: selector( <> ) | auto | none
   Initial: auto
 
@@ -883,17 +914,44 @@ instead of document's scrolling Element for auto.
   Name: start
   For: @scroll-timeline
-  Value: auto | <>
+  Value: <>
   Initial: auto
 
'start' descriptor determines the scroll timeline's {{start}}. +[=Scroll timeline offsets=] in CSS are represented by the +<> type: + +
+<scroll-timeline-offset> = auto | <> | <>
+<element-offset> = selector( <> ) [<> || <>]?
+<element-offset-edge> = start | end
+
+ +The offset type depends on the value of <> per +following: +
+: If value is "auto" or of type <> +:: The [=scroll timeline offset=] is a [=container-based offset=] with the same + value. + +: If value is of type <> +:: The [=scroll timeline offset=] is an [=element-based offset=] with the + following member values: + * {{ElementBasedOffset/target}} is the element identified by + <>. + * {{ElementBasedOffset/edge}} is the optional value of + <>. If not provided it defaults to "start". + * {{ElementBasedOffset/threshold}} is the optional value <>. If + not provided it defaults to 0. + +
   Name: end
   For: @scroll-timeline
-  Value: auto | <>
+  Value: <>
   Initial: auto