-
Notifications
You must be signed in to change notification settings - Fork 23.2k
Editorial review: Document scroll-triggered animations #43158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
70194d0
8901885
60e1ccf
4bd67a3
60bbe5d
85c0e99
cf303f0
a233f42
5c0d542
14f9cc6
fd77657
7519ba0
973031e
c5598c7
8041243
0628fc2
e75774c
03203ea
fa4d6b0
7a3fdc1
102b33e
8bb3916
2156be5
0ca2677
995848f
babef3b
92b891d
2161905
885e38e
b729f8c
4d2e419
eed4efa
e902040
8a59dd2
d5db7eb
6a65a83
4695fe0
670295e
23193dd
47c1446
43b1c16
d96df10
fa54bee
c7c5a38
f0b768e
9073144
6e10b85
71eb3c9
5fb7af0
7e5d1e4
9432d70
376a85a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| title: CSS animation triggers | ||
| short-title: Animation triggers | ||
| slug: Web/CSS/Guides/Animation_triggers | ||
| page-type: css-module | ||
| spec-urls: https://drafts.csswg.org/animation-triggers-1/ | ||
| sidebar: cssref | ||
| --- | ||
|
|
||
| The **CSS animation triggers** module provides functionality for triggering standard time-based [CSS animations](/en-US/docs/Web/CSS/Guides/Animations) when a particular trigger occurs, such as the user scrolling an element to a certain scroll offset inside the viewport, or a JavaScript event firing on an element. | ||
|
|
||
| ## Reference | ||
|
|
||
| ### Properties | ||
|
|
||
| - {{cssxref("animation-trigger")}} | ||
| - {{cssxref("timeline-trigger")}} shorthand | ||
| - {{cssxref("timeline-trigger-activation-range")}} shorthand | ||
| - {{cssxref("timeline-trigger-activation-range-end")}} | ||
| - {{cssxref("timeline-trigger-activation-range-start")}} | ||
| - {{cssxref("timeline-trigger-active-range")}} shorthand | ||
| - {{cssxref("timeline-trigger-active-range-end")}} | ||
| - {{cssxref("timeline-trigger-active-range-start")}} | ||
| - {{cssxref("timeline-trigger-name")}} | ||
| - {{cssxref("timeline-trigger-source")}} | ||
| - {{cssxref("trigger-scope")}} | ||
|
|
||
| The CSS animation triggers module level 1 also introduces the `event-trigger`, `event-trigger-name`, and `event-trigger-source` properties. Currently, no browsers support these features. | ||
|
|
||
| ### Data types and values | ||
|
|
||
| - {{cssxref("<animation-action>")}} | ||
|
|
||
| ## Guides | ||
|
|
||
| - [Using CSS scroll-triggered animations](/en-US/docs/Web/CSS/Guides/Animation_triggers/Using_scroll-triggered_animations) | ||
| - : A guide to implementing CSS scroll-triggered animations. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can add the animation timeline names guide here. What do you think? |
||
|
|
||
| ## Related concepts | ||
|
|
||
| - [CSS animations](/en-US/docs/Web/CSS/Guides/Animations) module | ||
| - {{cssxref("animation-timeline")}} | ||
| - {{cssxref("@keyframes")}} at-rule | ||
| - [`<keyframe-selector>`](/en-US/docs/Web/CSS/Reference/Selectors/Keyframe_selectors) | ||
| - [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations) module | ||
| - {{cssxref("animation-range")}} shorthand | ||
| - {{cssxref("animation-range-end")}} | ||
| - {{cssxref("animation-range-start")}} | ||
| - {{cssxref("scroll-timeline")}} shorthand | ||
| - {{cssxref("scroll-timeline-axis")}} | ||
| - {{cssxref("scroll-timeline-name")}} | ||
| - {{cssxref("timeline-scope")}} | ||
| - {{cssxref("view-timeline")}} shorthand | ||
| - {{cssxref("view-timeline-axis")}} | ||
| - {{cssxref("view-timeline-inset")}} | ||
| - {{cssxref("view-timeline-name")}} | ||
|
|
||
| ## Specifications | ||
|
|
||
| {{Specifications}} | ||
|
|
||
| ## See also | ||
|
|
||
| - [CSS scroll-triggered animations are coming!](https://developer.chrome.com/blog/scroll-triggered-animations) on developer.chrome.com (2025) | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -245,8 +245,6 @@ Click "Play" in the example above to see or edit the code for the animation in t | |||||||
| - {{cssxref("animation-timeline")}} | ||||||||
| - {{cssxref("animation-timing-function")}} | ||||||||
|
|
||||||||
| The CSS animations module level 2 also introduces the `animation-trigger`, `animation-trigger-exit-range`, `animation-trigger-exit-range-end`, `animation-trigger-exit-range-start`, `animation-trigger-range`, `animation-trigger-range-end`, `animation-trigger-range-start`, `animation-trigger-timeline`, and `animation-trigger-type` properties. Currently, no browsers support these features. | ||||||||
|
|
||||||||
| ### At-rules and descriptors | ||||||||
|
|
||||||||
| - {{cssxref("@keyframes")}} | ||||||||
|
|
@@ -280,6 +278,30 @@ All animations, even those with 0 seconds duration, throw animation events. | |||||||
|
|
||||||||
| ## Related concepts | ||||||||
|
|
||||||||
| - [CSS animation triggers](/en-US/docs/Web/CSS/Guides/Animation_triggers) module | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. triggers seems to expand scroll-driven, so we should invert these (i haven't read everything yet, so maybe wrong) |
||||||||
| - {{cssxref("animation-trigger")}} | ||||||||
| - {{cssxref("timeline-trigger")}} shorthand | ||||||||
| - {{cssxref("timeline-trigger-activation-range")}} shorthand | ||||||||
| - {{cssxref("timeline-trigger-activation-range-end")}} | ||||||||
| - {{cssxref("timeline-trigger-activation-range-start")}} | ||||||||
| - {{cssxref("timeline-trigger-active-range")}} shorthand | ||||||||
| - {{cssxref("timeline-trigger-active-range-end")}} | ||||||||
| - {{cssxref("timeline-trigger-active-range-start")}} | ||||||||
| - {{cssxref("timeline-trigger-name")}} | ||||||||
| - {{cssxref("timeline-trigger-source")}} | ||||||||
| - {{cssxref("trigger-scope")}} | ||||||||
| - [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations) module | ||||||||
| - {{cssxref("animation-range")}} shorthand | ||||||||
| - {{cssxref("animation-range-end")}} | ||||||||
| - {{cssxref("animation-range-start")}} | ||||||||
| - {{cssxref("scroll-timeline")}} shorthand | ||||||||
| - {{cssxref("scroll-timeline-axis")}} | ||||||||
| - {{cssxref("scroll-timeline-name")}} | ||||||||
| - {{cssxref("timeline-scope")}} | ||||||||
| - {{cssxref("view-timeline")}} shorthand | ||||||||
| - {{cssxref("view-timeline-axis")}} | ||||||||
| - {{cssxref("view-timeline-inset")}} | ||||||||
| - {{cssxref("view-timeline-name")}} | ||||||||
| - {{cssxref("will-change")}} CSS property | ||||||||
| - {{cssxref("easing-function")}} data type | ||||||||
| - [`prefers-reduced-motion`](/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion) media query | ||||||||
|
|
@@ -291,7 +313,7 @@ All animations, even those with 0 seconds duration, throw animation events. | |||||||
|
|
||||||||
| ## See also | ||||||||
|
|
||||||||
| - [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations) module. | ||||||||
| - [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations) module | ||||||||
| - Properties in the [transitions](/en-US/docs/Web/CSS/Guides/Transitions) CSS module to trigger animations based on user actions. | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| - The {{cssxref("interpolate-size")}} property and {{cssxref("calc-size()")}} function for enabling animations to and from [intrinsic size values](/en-US/docs/Glossary/Intrinsic_Size). | ||||||||
| - The {{htmlelement("canvas")}} HTML element along with [canvas API](/en-US/docs/Web/API/Canvas_API) and [WebGL API](/en-US/docs/Web/API/WebGL_API) to draw graphics and animations. | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,6 +150,18 @@ Scroll the element in the inline direction to see its background color change. S | |
| - {{cssxref("animation-timeline")}} | ||
| - {{cssxref("@keyframes")}} at-rule | ||
| - [`<keyframe-selector>`](/en-US/docs/Web/CSS/Reference/Selectors/Keyframe_selectors) | ||
| - [CSS animation triggers](/en-US/docs/Web/CSS/Guides/Animation_triggers) module | ||
| - {{cssxref("animation-trigger")}} | ||
| - {{cssxref("timeline-trigger")}} shorthand | ||
| - {{cssxref("timeline-trigger-activation-range")}} shorthand | ||
| - {{cssxref("timeline-trigger-activation-range-end")}} | ||
| - {{cssxref("timeline-trigger-activation-range-start")}} | ||
| - {{cssxref("timeline-trigger-active-range")}} shorthand | ||
| - {{cssxref("timeline-trigger-active-range-end")}} | ||
| - {{cssxref("timeline-trigger-active-range-start")}} | ||
| - {{cssxref("timeline-trigger-name")}} | ||
| - {{cssxref("timeline-trigger-source")}} | ||
| - {{cssxref("trigger-scope")}} | ||
| - [CSS overflow](/en-US/docs/Web/CSS/Guides/Overflow) module | ||
| - {{glossary("Scroll container")}} | ||
| - [Scrollport](/en-US/docs/Glossary/Scroll_container#scrollport) | ||
|
|
@@ -166,4 +178,5 @@ Scroll the element in the inline direction to see its background color change. S | |
|
|
||
| ## See also | ||
|
|
||
| - [Using CSS scroll-triggered animations](/en-US/docs/Web/CSS/Guides/Animation_triggers/Using_scroll-triggered_animations) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we can add this to the guide list. What do you think? |
||
| - [Animate elements on scroll with scroll-driven animations](https://developer.chrome.com/docs/css-ui/scroll-driven-animations) via developer.chrome.com (2023) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.