Re: [csswg-drafts] [animation-triggers-1] Should play-forwards and play-backwards have no effect if the animation has already reached its end? (#13643)

> And, as I understand it, this is what @flackr is trying to prevent, and I agree, otherwise, having multiple triggers per animation becomes kind of useless.

To be clear, what I thought makes more sense is that trying to play-forwards the animation again (e.g. by clicking the second button) does not restart it. You would still have to click the button again to play-backwards since you created it as a stateful button.

However, you can also create buttons that don't have an exit state and are stateless:
```
.button-1 {
  event-trigger: --c1 click;
}

.button-2 {
  event-trigger: --c2 click;
}

.target {
  animation: slide 1s both;
  animation-trigger: --c1 play-forwards --c2 play-backwards;
}
```

What I thought makes more sense is that `.button-1` will only advance the animation forwards, *not* restart it when it is already finished and you click the button instead. Similarly for `.button-2` except in the reverse direction. These would function as play and rewind buttons buttons like on a tape player.

> Another option I can think of is changing the whole model of "name-clashing" for triggers.
We could say trigger names "add" and don't "clash", they add more event registrations to the same trigger instance. And then if you want multiple triggers it simply means reusing the same name, plus we go back to single trigger per animation, and that would look like:

I think I had mentioned that I was in favour of this in a prior call. Unlike timelines where you need to use a single time, there's no reason we can't combine events from different sources as activation / deactivation events for a single named trigger. TLDR, I agree we should do this, but this is a separate issue right?

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


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

Received on Tuesday, 24 March 2026 12:57:33 UTC