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
Updates related to the animation-composition property #19940
Conversation
files/en-us/web/css/css_animations/using_css_animations/index.md
Outdated
Show resolved
Hide resolved
|
||
```css | ||
animation-name: fadeInOut, moveLeft300px, bounce; | ||
animation-duration: 2.5s, 5s, 1s; | ||
animation-iteration-count: 2, 1, 5; | ||
``` | ||
|
||
In this third case, there are three animations specified, but only two durations and iteration counts. In such cases where there are not enough values to give a separate value to each animation, the values cycle from start to finish. So for example, fadeInOut gets a duration of 2.5s and moveLeft300px gets a duration of 5s. We've now got to the end of the available duration values, so we start from the beginning again — bounce therefore gets a duration of 2.5s. The iteration counts (and any other property values you specify) will be assigned in the same way. | ||
In this third example, three animations are specified, but only two durations and iteration counts. In such cases where there are not enough values in the list to assign a separate one to each animation, the value assignment cycles from the first to the last item in the available list and then resets to the first tem. So, `fadeInOut` gets a duration of `2.5s`, and `moveLeft300px` gets a duration of `5s`, which is the last value in the list of duration values. The duration value assignment now resets to the first value; `bounce`, therefore, gets a duration of `2.5s`. The iteration count values (and any other property values you specify) will be assigned in the same way. |
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.
In this third example, three animations are specified, but only two durations and iteration counts. In such cases where there are not enough values in the list to assign a separate one to each animation, the value assignment cycles from the first to the last item in the available list and then resets to the first tem. So, `fadeInOut` gets a duration of `2.5s`, and `moveLeft300px` gets a duration of `5s`, which is the last value in the list of duration values. The duration value assignment now resets to the first value; `bounce`, therefore, gets a duration of `2.5s`. The iteration count values (and any other property values you specify) will be assigned in the same way. | |
In this third example, three animations are specified, but only two durations and iteration counts. In such cases where there are not enough values in the list of durations to assign a separate one to each animation, the value assignment cycles from the first to the last item in the available list and then cycles back to the first item. So, `fadeInOut` gets a duration of `2.5s`, and `moveLeft300px` gets a duration of `5s`, which is the last value in the list of duration values. The duration value assignment now resets to the first value; `bounce`, therefore, gets a duration of `2.5s`. The iteration count values (and any other property values you specify) will be assigned in the same way. | |
If the mismatched length lists are inverted -- for example, if there are five `animation-duration` values for three `animation-name` values -- the extraneous animation property values, in this case, two `animation-duration` values, don't apply to any animation and are ignored. |
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.
It would be good to give this section and #### title, so we can link to it directly from the five animation pages where we have:
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.
This is a great suggestion. As I started working through it, I ended up pulling out "Using the animation shorthand" and "Setting multiple animation property values" sections from inside "Examples" and turned them from ### to ##.
I started to add ###s under "Setting multiple animation property values" as you've suggested but it seems two cases in the "Setting multiple animation property values" section are applicable in the other animation pages where we have that note. So it might not be worth adding the ###s and linking to just the last case.
BTW, thank you for suggesting the text for the inverse case 👍.
files/en-us/web/css/css_animations/using_css_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/css_animations/using_css_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/css_animations/using_css_animations/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/css_animations/using_css_animations/index.md
Outdated
Show resolved
Hide resolved
dfd1abe
to
eb2a577
Compare
files/en-us/web/css/css_animations/using_css_animations/index.md
Outdated
Show resolved
Hide resolved
``` | ||
|
||
To learn more about the sequence in which different animation property values can be specified using the `animation` shorthand, see the {{cssxref("animation")}} reference page. | ||
|
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.
should we add a warning to recommend putting the name last, since if a keyframe name is a keyword, the browser assumes the first instance is the keyword, not the name.
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.
Text to this effect is present on the animation page, which is where the link is pointing.
(The sequence of sections on the 'animation' page does not seem consistent with other pages. I'll open another PR to fix that.)
Just three questions, then we're good to go. |
I am on vacation next week. But my review isn't blocking |
w3c/csswg-drafts#1594 provides an even better example. |
eb2a577
to
c680c01
Compare
You'll find the glossary update in the other PR 🙂 |
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.
(I'm not a CSS expert, not sure why I'm getting CSS review requests)
I skimmed over this and it looks good to me and it seems Estelle's comments are addressed, so approving. Feel free to merge (Estelle also said nothing blocking anymore).
Going to merge this one now, thanks all 👍🏻 |
Thanks, @bsmth! |
* Adds link to animation-composition plus other edits * Fixes errors * Fixes review comments * Fixes review comments Co-authored-by: Brian Thomas Smith <brian@smith.berlin>
Summary
animation-composition
property ([CSS] New property page for animation-composition #19848)Related issues
Doc issue tracker: #18771
Metadata