Editorial review: Document scroll-triggered animations#43158
Editorial review: Document scroll-triggered animations#43158chrisdavidmills wants to merge 52 commits intomdn:mainfrom
Conversation
bramus
left a comment
There was a problem hiding this comment.
I’m halfway through reviewing but already submitting my comments as I see there are some terms that are getting used in places where they should not be.
The themes I am seeing, where wrong names are use:
-
A trigger vs an animation becoming active / inactive: it is the trigger that becomes active / inactive. Animations will do something (play, pause, etc) in response to that trigger becoming active / inactive.
-
An element being a trigger vs a ViewTimeline being a trigger: it is the ViewTimeline that is the trigger, not the element itself.
I’m seeing these terms (trigger / animation / element) get mixed up through all files I reviewed.
Files I did not review, but most likely also have this mixup:
- files/en-us/web/css/reference/properties/timeline-trigger-active-range-end/index.md
- files/en-us/web/css/reference/properties/timeline-trigger-activation-range/index.md
- files/en-us/web/css/reference/properties/timeline-trigger-active-range-start/index.md
- files/en-us/web/css/reference/properties/timeline-trigger-active-range/index.md
- files/en-us/web/css/reference/properties/timeline-trigger-name/index.md
- files/en-us/web/css/reference/properties/timeline-trigger-source/index.md
- files/en-us/web/css/reference/properties/timeline-trigger/index.md
- files/en-us/web/css/reference/properties/trigger-scope/index.md
All other files I have reviewed, and left suggestions that you can immediately apply.
I can do a second review round later, but currently I’m overly busy with some other things.
files/en-us/web/css/guides/animation_triggers/using_scroll-triggered_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/guides/animation_triggers/using_scroll-triggered_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/guides/animation_triggers/using_scroll-triggered_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/guides/animation_triggers/using_scroll-triggered_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/guides/animation_triggers/using_scroll-triggered_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/timeline-trigger-activation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/timeline-trigger-activation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/timeline-trigger-activation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/timeline-trigger-activation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/timeline-trigger-activation-range/index.md
Outdated
Show resolved
Hide resolved
…ggered_animations/index.md Co-authored-by: Bramus <bramus@bram.us>
…ggered_animations/index.md Co-authored-by: Bramus <bramus@bram.us>
…ggered_animations/index.md Co-authored-by: Bramus <bramus@bram.us>
…ggered_animations/index.md Co-authored-by: Bramus <bramus@bram.us>
…ggered_animations/index.md Co-authored-by: Bramus <bramus@bram.us>
…ggered_animations/index.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…ex.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range-end/index.md Co-authored-by: Bramus <bramus@bram.us>
Co-authored-by: Bramus <bramus@bram.us>
Co-authored-by: Bramus <bramus@bram.us>
…vation-range-start/index.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range/index.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range/index.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range/index.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range/index.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range/index.md Co-authored-by: Bramus <bramus@bram.us>
…vation-range/index.md Co-authored-by: Bramus <bramus@bram.us>
estelle
left a comment
There was a problem hiding this comment.
didn't get very far. committing what i have thus far.
| - {{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. |
There was a problem hiding this comment.
| 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. | |
| The CSS animation triggers module also introduces the `event-trigger`, `event-trigger-name`, and `event-trigger-source` properties. Currently, no browsers support these features. |
|
|
||
| > [!NOTE] | ||
| > {{cssxref("animation-timeline")}}, {{cssxref("animation-range-start")}}, and {{cssxref("animation-range-end")}} are not currently included in this list, as current implementations are reset-only. This means that including `animation` resets a previously-declared `animation-timeline` value to `auto` and previously-declared `animation-range-start` and `animation-range-end` values to `normal`, but these properties cannot be set via `animation`. When creating [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations), you need to declare these properties after declaring any `animation` shorthand for it to take effect. | ||
| > {{cssxref("animation-timeline")}}, {{cssxref("animation-range-start")}}, {{cssxref("animation-range-end")}} and {{cssxref("animation-trigger")}} are not currently included in this list, as current implementations are reset-only. This means that including `animation` resets a previously-declared `animation-timeline` value to `auto`, previously-declared `animation-range-start` and `animation-range-end` values to `normal`, and a previously-declared `animation-trigger` to `none`, but these properties cannot be set via `animation`. When creating CSS [scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations) or [triggered animations](/en-US/docs/Web/CSS/Guides/Animation_triggers), you need to declare these properties after declaring any `animation` shorthand for them to take effect. |
There was a problem hiding this comment.
only animation-timeline is in the shorthand i think, so i don't think this resets the other properties. did you test?
| /* Named timeline range value */ | ||
| timeline-trigger-activation-range-end: contain; | ||
| timeline-trigger-activation-range-end: exit; | ||
| timeline-trigger-activation-range-end: entry 100%; |
There was a problem hiding this comment.
separate the named-only and the named with offsets
| timeline-trigger-activation-range-end: 80%; | ||
| timeline-trigger-activation-range-end: 400px; | ||
|
|
||
| /* Named timeline range value */ |
There was a problem hiding this comment.
| /* Named timeline range value */ | |
| /* Named timeline range */ |
|
|
||
| ```css | ||
| /* Keyword or <length-percentage> */ | ||
| timeline-trigger-activation-range-end: normal; |
There was a problem hiding this comment.
let's break apart: put normal under a keyword -only header, and vals under a offset header
|
|
||
| If the `<timeline-range-name>` value does not include a `<length-percentage>`, the percentage defaults to `100%`. | ||
|
|
||
| The `timeline-trigger-activation-range-end`, along with the {{cssxref("timeline-trigger-activation-range-start")}} property, can both be set in a single declaration using the {{cssxref("timeline-trigger-activation-range")}} shorthand. |
There was a problem hiding this comment.
| The `timeline-trigger-activation-range-end`, along with the {{cssxref("timeline-trigger-activation-range-start")}} property, can both be set in a single declaration using the {{cssxref("timeline-trigger-activation-range")}} shorthand. | |
| The `timeline-trigger-activation-range-end` and {{cssxref("timeline-trigger-activation-range-start")}} properties can both be set in a single declaration using the {{cssxref("timeline-trigger-activation-range")}} shorthand. |
|
|
||
| - [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. |
There was a problem hiding this comment.
| - Properties in the [transitions](/en-US/docs/Web/CSS/Guides/Transitions) CSS module to trigger animations based on user actions. | |
| - [CSS animation triggers](/en-US/docs/Web/CSS/Guides/Animation_triggers) module | |
| - [CSS transitions](/en-US/docs/Web/CSS/Guides/Transitions) module |
|
|
||
| ## See also | ||
|
|
||
| - [Using CSS scroll-triggered animations](/en-US/docs/Web/CSS/Guides/Animation_triggers/Using_scroll-triggered_animations) |
There was a problem hiding this comment.
i think we can add this to the guide list. What do you think?
| ## 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. |
There was a problem hiding this comment.
I think we can add the animation timeline names guide here. What do you think?
|
|
||
| ## Related concepts | ||
|
|
||
| - [CSS animation triggers](/en-US/docs/Web/CSS/Guides/Animation_triggers) module |
There was a problem hiding this comment.
triggers seems to expand scroll-driven, so we should invert these (i haven't read everything yet, so maybe wrong)
Description
Chrome 146 adds support for scroll-triggered animations; see https://chromestatus.com/feature/5181996801982464.
This PR adds documentation for this new feature, including:
animation-triggerproperty.<animation-action>type.trigger-scopeproperty.timeline-triggershorthand property.timeline-trigger-nameproperty.timeline-trigger-sourceproperty.timeline-trigger-activation-rangeshorthand property.timeline-trigger-activation-range-startproperty.timeline-trigger-activation-range-endproperty.timeline-trigger-active-rangeshorthand property.time-trigger-active-range-startproperty.time-trigger-active-range-endproperty.Motivation
Additional details
Related issues and pull requests