-
Notifications
You must be signed in to change notification settings - Fork 690
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
[scroll-animations-1][css-animations-2] Add animation-range to animation shorthand #8054
Comments
A few questions:
|
Another question: It used to be common for scroll-linked animations, which were all based on Is there a way to achieve this? I guess simply using positive/negative values won't work, perhaps with using |
The intent would be to add end delay to the shorthand definition, though putting the start and end in one function is also fine with me. This could be delay or range, whichever we go with in #7901.
I would prefer it being mandatory, though if we have a positional function like you proposed it might be reasonable to default to 0% for the start range / delay and 100% for the end range / delay.
Isn't this just becoming the same as the offset function? |
This issue is merely to decide on the syntax for the animation shorthand ideally avoiding parsing ambiguity. It is a helper for all of the longhand properties. If in #7575 we decide to go with allowing lengths there then we would allow them here as well. |
I suspect this is a nice to have but that we could not support the new properties and values in the short-hand for the initial version. |
(Agreed that it's not necessary to support the new features in the |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> s/Topic/Subtopic/<TabAtkins> fantasai: proposed resolution is we don't need to support new features in the 'animation' shorthand <TabAtkins> (agreed, the animation shorthand is already a trash fire of parsing) <TabAtkins> fantasai: We might come up with a good idea for later, but for now <TabAtkins> astearns: Close the issue, or tag it to a different level? <TabAtkins> fantasai: tag it <TabAtkins> astearns: so proposed resolution is "not now" <TabAtkins> dbaron: The shorthand is still resetting those new props, just can't set them? <TabAtkins> fantasai: yes <TabAtkins> RESOLVED: New features are not added to the animation shorthand (for now), they're just reset |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I would propose |
We already resolved here on expanding the syntax as Regarding |
scroll-animations-1 upgrades animation-delay to both be a shorthand for animation-delay-start and animation-delay-end as well as to support a new syntax for each of animation-delay-start and animation-delay-end of
<timeline-range-name> <percentage>
and just a<timeline-range-name>
by itself for the overall property. Note that issue #7901 is bikeshedding some of the particulars but the high level is that more values will be part of animation-delay.Since
animation-delay
is also part of the animation short-hand we also have to make sure that these new values can be uniquely parsed and differentiated from other properties in that shorthand. Issue #6946 touches on the general difficulty of extending the animation shorthand.If we assume the format of
<animation-delay>
within theanimation
property is the same, we will have a compat risk with any named ranges which could overlap with animation keyframe names (i.e. currentlycover
,contain
,enter
,exit
but potentially user defined range names in the future), as well as limit the ability to add any other numerical properties which could be confused with the offsets (currently percentages but #7575 will likely add lengths as well).After discussing this with @andruud, we think functional notation would make animation delays unambiguous w.r.t animation-names or other future values which may also want to specify lengths, times, percentages. Specifically, we could add two functions (open to bikeshedding names):
offset(<timeline-range-name> <percentage>)
would map to an animation-delay, the first occurrence being start delay and the second being end delay. (Alternate name ideas: delay to be consistent with underlying property)range(<timeline-range-name>)
would map toanimation-delay: <timeline-range-name> 0% <timeline-range-name> 100%
.The scroll-animations spec also builds on the ability to specify an animation-timeline which has additionally been added to the animation shorthand in css-animations-2. The spec doesn't currently explain how to disambiguate a named timeline from an animation-name, but we could either use the positions like we do to currently differentiate duration and start delay or we could add a function for this as well, e.g.
timeline(<timeline-name>)
to unambiguously specify a timeline. We could keep the existing support for referring to anonymous timelines since those already have a functional notation. Open to other ideas here. @tabatkinsThe text was updated successfully, but these errors were encountered: