-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Add docs for CSS Scroll-driven animations #27075
Add docs for CSS Scroll-driven animations #27075
Conversation
Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: Dipika Bhattacharya <[email protected]>
Co-authored-by: Dipika Bhattacharya <[email protected]>
Please note that a late change to the spec changed the syntax for Furthermore |
And oh, |
- `timeline` {{optional_inline}} | ||
- : A property unique to `animate()`: the {{domxref("AnimationTimeline")}} to associate with the animation. Defaults to {{domxref("Document.timeline")}}. | ||
- : A property unique to `animate()`: The {{domxref("AnimationTimeline")}} to associate with the animation. Defaults to {{domxref("Document.timeline")}}. | ||
|
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.
rangeStart
and rangeEnd
are missing here.
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.
Ah, I originally left them out because they didn't seem to do anything. I think it was around the time when the implementation was in progress. They do seem to work now, although some of the value effects aren't what I'd quite expect. Do all of the value types as specced work, in your experience?
My descriptions are in my next commit.
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.
From my experience they seemed to work well. Only used the string variation though, where I – for example – set rangeEnd
to "cover 100%"
instead of an object.
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.
Hrm, I wonder whether I should just list the string values then, at least for now, while we investigate the other options.
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.
OK, so to clear this up, I've added clear examples of the string values, and made the values used in the on-page example string values. If it turns out people want more information of examples on the other value types, we can always add them later.
- : Returns the time value in milliseconds for this timeline or `null` if this timeline is inactive. | ||
|
||
## Instance methods |
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 method is no longer part of scroll-animations-1, as per w3c/csswg-drafts#8765 (comment) resolution
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.
Hrm, I deleted this in my last commit, but it seems to be back again today. I've deleted it in my next commit.
- : The scrollbar on the block axis of the scroll container, which is the axis in the direction perpendicular to the flow of text within a line. For horizontal writing modes, such as standard English, this is the same as `vertical`, while for vertical writing modes, it is the same as `horizontal`. | ||
- `inline` | ||
- : The scrollbar on the inline axis of the scroll container, which is the axis in the direction parallel to the flow of text in a line. For horizontal writing modes, this is the same as the `horizontal` axis, while for vertical writing modes, this is the same as `vertical`. | ||
- `vertical` |
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 should be y
. vertical
once was part of the spec, but no longer is as per w3c/csswg-drafts#8666 (comment) resolution.
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.
Darnit. I fixed this on the CSS *-timeline-axis
pages, but forgot about this one. Fixed now.
- : The scrollbar on the inline axis of the scroll container, which is the axis in the direction parallel to the flow of text in a line. For horizontal writing modes, this is the same as the `horizontal` axis, while for vertical writing modes, this is the same as `vertical`. | ||
- `vertical` | ||
- : The scrollbar on the vertical axis of the scroll container. | ||
- `horizontal` |
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 should be x
. horizontal
once was part of the spec, but no longer is as per w3c/csswg-drafts#8666 (comment) resolution.
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.
Darnit. I fixed this on the CSS *-timeline-axis
pages, but forgot about this one. Fixed now.
|
||
- `block`: The scrollbar on the block axis of the scroll container, which is the axis in the direction perpendicular to the flow of text within a line. For horizontal writing modes, such as standard English, this is the same as `vertical`, while for vertical writing modes, it is the same as `horizontal`. | ||
- `inline`: The scrollbar on the inline axis of the scroll container, which is the axis in the direction parallel to the flow of text in a line. For horizontal writing modes, this is the same as the `horizontal` axis, while for vertical writing modes, this is the same as `vertical`. | ||
- `vertical`: The scrollbar on the vertical axis of the scroll container. |
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 should be y
. vertical
once was part of the spec, but no longer is as per w3c/csswg-drafts#8666 (comment) resolution.
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.
Darnit. I fixed this on the CSS *-timeline-axis
pages, but forgot about this one. Fixed now.
|
||
- `none` | ||
- : The timeline has no name. | ||
- `<custom-ident>` |
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.
- `<custom-ident>` | |
- `<dashed-ident>` |
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've updated this in my next commit
## Syntax | ||
|
||
```css | ||
/* two values: one each for view-timeline-name and view-timeline-axis */ |
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.
All names need updating to <dashed-ident>
variations
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.
Done. I've updated all instances of custom_name_for_timeline
to --custom_name_for_timeline
.
@@ -32,8 +29,10 @@ Allowed values for `scroll-timeline-name` are: | |||
- `none` | |||
- : The timeline has no name. | |||
- `<custom-ident>` |
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.
- `<custom-ident>` | |
- `<dashed-ident>` |
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.
done
- : An arbitrary custom identifier that can be used to reference the scroll timeline in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline). | ||
Possible values are described in [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident). | ||
|
||
- : An arbitrary custom identifier defining a name for a scroll progress timeline, which can then be referenced in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline) property. See [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident) for more details about permitted values. |
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.
- : An arbitrary custom identifier defining a name for a scroll progress timeline, which can then be referenced in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline) property. See [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident) for more details about permitted values. | |
- : An arbitrary custom identifier defining a name for a scroll progress timeline, which can then be referenced in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline) property. See [`<dashed-ident>`](/en-US/docs/Web/CSS/dashed-ident) for more details about permitted values. |
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.
done
- : The timeline has no name. | ||
- `<custom-ident>` | ||
|
||
- : An arbitrary custom identifier defining a name for a view progress timeline, which can then be referenced in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline) property. See [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident) for more details about permitted values. |
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.
- : An arbitrary custom identifier defining a name for a view progress timeline, which can then be referenced in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline) property. See [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident) for more details about permitted values. | |
- : An arbitrary custom identifier defining a name for a view progress timeline, which can then be referenced in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline) property. See [`<dashed-ident>`](/en-US/docs/Web/CSS/dashed-ident) for more details about permitted values. |
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.
line 32?
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.
Line 32 and line 34.
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.
done
OK, in the first commit since @bramus reviewed, I have:
I'll start working through all the above comments tomorrow. |
@bramus OK, I've done some testing and it looks like all my changes have stuck this time. Let me know if you spot anything else. |
Description
The Scroll-driven animations spec is mostly supported in Chromium 115. This PR adds content for the new properties, functions, and other syntax defined in this spec, plus some related features from CSS Animations Level 2.
See my research document for more details as to what has been added. Note that this document includes some specific comments about items that still don't seem to be supported correctly in Chrome. In some cases, they are waiting for bugs to be fixed, but if those bugs don't get fixed by the time of launch, we might have to revert a bit of BCD data.
Motivation
Additional details
Related issues and pull requests
Fixes #26544