Re: [csswg-drafts] [web-animations-2][css-animations-2] animation-trigger CSS syntax (#12652)

> 1. It doesn't make sense to have to declare **2** idents in order to bind an animation to an event trigger, as in `trigger(--foo, --bar play)`. If the action was global, as in declared via an at-rule, then it would make sense, but this is not the case, and both are scoped to same element. It should be enough to declare a name and a list of of event types, and bind that to a behavior.

An author wouldn't **have to** declare 2 idents. The higher-level names (`--bar` in your example) just create an easier way for an author to bind multiple events to a single behavior instead of having to specify multiple `trigger()` declarations or multiple parameters within a `trigger()` declaration.
 
> 2. It doesn't make sense to have to declare a specific `enter` and `exit` behavior on a `timeline-trigger`. If we we're already exposing this property as a very specific thing, it should be obvious it has an entry/exit events. This property should be as simple as specifying a name, a timeline, and ranges. And binding it on the animation with an action should just as simple as the case with events.

`timeline-trigger` *does* just specify a name, timeline, and ranges. It also does *not* specify behavior. Authors don't **have to** specify any event on `timeline-trigger`. behavior is specified on `animation-trigger` just like with `event-trigger`. Like @flackr [described](https://github.com/w3c/csswg-drafts/issues/12652#issuecomment-3234466432) above, the granular "play-*" behaviors in this proposal cover the original set of use cases we were concerned with. They also provide additional flexibility for use cases like the one Tab and Elika point out in their [original proposal](https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-3091201201) where you want to "play on click, pause on exit" in which you are mixing and matching triggers of different types and don't necessarily want "play on enter" behavior on the timeline-trigger.



-- 
GitHub Notification of comment by DavMila
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12652#issuecomment-3259262750 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 5 September 2025 17:48:25 UTC