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

> > 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.

In the [example in your proposal](https://github.com/w3c/csswg-drafts/issues/12652#issue-3352569253) you have 2 names:

```css
.event_target {
  animation-trigger: trigger(--event-source, --click-touch play-pause, --press-p play, keypress("r") reset);
}
```

These are 2 idents you need, like:`--event-source` and `--click-touch`.
I'm saying you only need one of them.

And you have 2 sub-properties: `event-trigger-name` and `event-trigger-actions`, which take an ident.
I propose to have a coordinated list of `-name` and `-actions`, where you only specify ident in `-name` and corresponding actions (or types, or whatever) in the `-actions` property.

Correspondingly, The `trigger()` function shouldn't take and extra first ident argument.

If you proposal does that then I don't see it written there 🤷 

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


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

Received on Saturday, 6 September 2025 08:03:38 UTC