- From: David A via GitHub <noreply@w3.org>
- Date: Thu, 07 Aug 2025 14:39:28 +0000
- To: public-css-archive@w3.org
> I don't know about multiple triggers yet, but trying to continue from that notion of statelessness and `start`/`end` triggers. > Okay. I had a chat with @szager-chromium where we discussed describing `event-trigger-actions` like this: `event-trigger-actions: click(play) keypress(pause);` Seems like it might be feasible to describe a timeline-based trigger with event-trigger, perhaps with something like: `event-trigger-actions: viewenter(play, block, contain 0%[, contain 100%]);`, and to describe "play on enter, reverse on exit", we could say something like: `event-trigger-actions: viewenter(play-forwards, block, contain 0%[, contain 100%]) viewexit(play-backwards, block, contain 0%[, contain 100%]);` However I feel like timeline-trigger, with its longhands, is simpler and more familiar (similar to `animation-timeline` and `animation-range-*` longhands) way of expressing the same thing, so I think we should keep it. > Although, if we are left with only event triggers, and everything is more stateless, then moving towards multiple triggers becomes much easier. Whether we express timeline-based triggering in event-trigger or timeline-trigger, we'll still have to track the exact same "in-range" state you mention above, so I'm not at all seeing how this affects statelessness. The definitions of the actions, i.e. play, pause, etc, are the same regardless of the trigger type. Can you elaborate? One issue that does occur to me with having `event-trigger` and `timeline-trigger` is name clashing between these two properties. I.e.: ``` #source { event-trigger: --trigger; timeline-trigger: --trigger; } #target { animation: ...; animation-trigger: --trigger; } ``` Does `#target` get a TimelineTrigger or an EventTrigger? My feeling is that it should get a TimelineTrigger because we can think a TimelineTrigger as a special case of an EventTrigger which has not just a "primary" (i.e. "start") class of events (enter) but also a "secondary" (i.e. "end") class of events (exit). So timeline-trigger should take precedence when both and present and clash on name. -- GitHub Notification of comment by DavMila Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-3164474615 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 7 August 2025 14:39:29 UTC