Closed bramus closed 1 year ago
Yeah, it's weird that the order is reversed. Is that intentional @fantasai?
Especially since we don't disallow block/inline/etc from <custom-ident>, so:
view-timeline:block
creates a timeline named block
, with the default axis.scroll-timeline:block
creates no timeline, since it has no name.See also https://github.com/w3c/csswg-drafts/pull/7694 (which doesn't address the ordering, but it's related).
Pretty sure that's not intentional, I agree we should fix it to be consistent.
@bramus Flipped ordering of scroll-timeline as you suggested. I agree we should discuss fixing the ordering, since reorderability is creating an unfortunate parsing ambiguity here. :(
Going further, maybe we should disallow reordering the values? There is precedent to have the
*-name
first: thecontainer
shorthand has thecontainer-name
first and then the container-type.
animation
has animation-name
last (conflict with animation-fill-mode
for none
).
See also #7694 (which doesn't address the ordering, but it's related).
I presume that the topic related to this PR is about whether none
can repeat. Some context: none
can repeat in animation
for animation-name
(but the <custom-ident>
for @keyframes
prelude excludes the none
keyword) but it cannot in transition
for transition-property
(there is a minor issue related to how this is enforced).
The current view-timeline-name
syntax does not allow repeating none
but the current view-timeline
syntax does. There is also:
If
view-timeline-name
has more names thanview-timeline-axis
has specified axes, the excess timelines use the lastview-timeline-axis
value. Ifview-timeline-name
has fewer names than view-timeline-axis has specified axes, the used view-timeline-axis list is truncated.
If this difference is unintentional and none
should not repeat in view-timeline
AND view-timeline-name
, it seems simpler and clearer to enforce it in prose rather than in the syntax (cf. my suggestion in the linked issue related to transition
).
After reading this thread, I wonder if none
could not be further restricted to be used alone in transition
and view-timeline
.
First, animation-name: none is basically a special value for disabling an animation or set of animations; there's really no reason to use it with a list, only on its own, since when animation-name is none all the other properties are irrelevant.
Would there be a reason to use transition: none 1s;
or view-timeline: none inline
?
animation: none 1s
would still have to be valid because none
must be assigned to animation-fill-mode
.
Agenda+ to discuss if we want to address the parsing ambiguity by fixing the order of arguments, or something else.
The proposal is to have:
scroll/animation-timeline: <name> <axis>?
rather than
scroll/animation-timeline: <name> || <axis>
The CSS Working Group just discussed [scroll-animations-1] `scroll-timeline` and `view-timeline` shorthand syntax
, and agreed to the following:
RESOLVED: Have parsing with fixed order of name and axis
The syntax for the
scroll-timeline
shorthand is defined as such:The syntax for the
view-timeline
shorthand is defined as such:It’s odd that the
scroll-timeline
has the name mentioned first, while inview-timeline
it is the axis. Even though the order of both does not matter – due to||
– I would like to see these listed in the same order for consistency reasons.Going further, maybe we should disallow reordering the values? There is precedent to have the
*-name
first: thecontainer
shorthand has thecontainer-name
first and then thecontainer-type
.Maybe we can update the
scroll-timeline
andview-timeline
shorthands to follow the form of thecontainer
shorthand? Like so: