Skip to content
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] Should none be part of the list in scroll/view-timeline-name? #8843

Closed
andruud opened this issue May 15, 2023 · 7 comments

Comments

@andruud
Copy link
Member

andruud commented May 15, 2023

The scroll-timeline-name and view-timeline-name properties have this grammar: none | <custom-ident>#. That is fine in isolation, but it's inconsistent with animation-name, which has [ none | <custom-ident> ]#, and that made me wonder if it's intentional.

If it is intentional, then feel free to close this.

@fantasai

@andruud andruud added the scroll-animations-1 Current Work label May 15, 2023
@ydaniv
Copy link
Contributor

ydaniv commented May 15, 2023

I think it's intentional since these are timeline declarations that can be matched by definitions of animation-timeline's and are matched by name, and not by position in the list. So it's either a list of names or none.

@tabatkins
Copy link
Member

Yeah, animation-name's use of none as any item in the list (which just "turns off" that entry in the list) is pretty odd actually.

@andruud
Copy link
Member Author

andruud commented May 18, 2023

OK, in that case, how am I supposed to interpret the grammar of scroll-timeline:

[ <'scroll-timeline-name'> [ <'scroll-timeline-axis'> || <'scroll-timeline-attachment'> ]? ]#

I'm aware of css-values-4:

These types do not include CSS-wide keywords such as inherit, and also do not include any top-level comma-separated-list multiplier (i.e. if a property named pairing is defined as [ <custom-ident> <integer>? ]#, then <'pairing'> is equivalent to [ <custom-ident> <integer>? ], not [ <custom-ident> <integer>? ]#).

But scroll-timeline-name doesn't have top-level comma-separated-list multipliers.

Even if you ignore that, the grammar would suggest that scroll-timeline: none, none, none is allowed, even though it's not allowed by the longhand?

Yeah, animation-name's use of none as any item in the list (which just "turns off" that entry in the list) is pretty odd actually.

Yet if scroll-timeline worked like that it seems to answer all my questions, so maybe not that odd. :-)

@fantasai
Copy link
Collaborator

fantasai commented Jun 2, 2023

Hm, yes, it does seem we have a problem. :) I think the two options are:

  • Allow none as an alternative to <custom-ident> in *-timeline-name, essentially disables that entry in the coordinated properly list.
  • Rework the grammars explicitly so that both *-timeline-name and the *-timeline shorthand have none | <whatever>.

@ydaniv
Copy link
Contributor

ydaniv commented Jun 3, 2023

ah, for coordinating between longhand lists, I see.
So the options mean either keep allowing none for -name for disabling a single entry, or only allowing it as the entire value for disabling all timelines of that type, right?
Although it won't be necessary in most cases, I guess the first option allows more flexibility, and it may seem strange to developers that they have to remove an entry from all properties to disable it.

@tabatkins
Copy link
Member

Yeah, I suppose following the animation-name model works. It's weird and I don't particularly like it, but it works slightly better with a few of our abstractions.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [scroll-animations-1] Should `none` be part of the list in scroll/view-timeline-name?, and agreed to the following:

  • RESOLVED: Allow a list of nones
The full IRC log of that discussion <dael> fantasai: This issue was brought b/c right now the way values are spec, scroll-timeline name is none or a list of comma spec idents. But background-image and the like is a list of nones or whatever so can have a list of nones.
<dael> fantasai: Question here is shorthand drafted as inconsitent. Do we want pattern to have a list of nones or make that explicitly not possible
<dael> fantasai: Seem to be leaning toward a list of nones for consistency and it allows an author to turn off a timeline without taking out definition from all properties you can flip it to none
<dael> flackr: I support allowing a list of nones
<dael> fantasai: Prop: Allow list of nones
<dael> Rossen_: Any opinions?
<dael> florian: Seems reasonable. No strong opinion.
<dael> Rossen_: Objections:
<dael> RESOLVED: Allow a list of nones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants