Re: [csswg-drafts] [animation-triggers-1] Multiple named triggers (#13710)

The CSS Working Group just discussed `[animation-triggers-1] Multiple named triggers`, and agreed to the following:

* `RESOLVED: Allow event triggers with the same name to combine into a single named trigger.`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> ydaniv: Currently, the way we define event-trigger and timeline-trigger, when you provide a custom-ident as the name for the trigger, multiple declarations of the same name overwrite each other<br>
&lt;fantasai> ydaniv: but if you want multiple triggers, managing this state becomes impossible<br>
&lt;fantasai> ydaniv: So what we propose here is to take a different approach<br>
&lt;fantasai> ydaniv: Instead of clashing, they merge<br>
&lt;fantasai> ydaniv: When you set an event trigger with a custom-ident, and another trigger with the same name<br>
&lt;fantasai> ydaniv: Instead of creating trigger instances, they create attachment points to triggers<br>
&lt;fantasai> ydaniv: and when you specify the usage on an animation-trigger, that's where the trigger instance is created<br>
&lt;fantasai> ydaniv: and it attaches to all of those place<br>
&lt;fantasai> ydaniv: So this is the proposed behavior<br>
&lt;fantasai> flackr: The trigger isn't created at the point where you use it. It's just a conceptual thing that exists. All the named events are contributing towards it.<br>
&lt;DavidA> q+<br>
&lt;fantasai> ydaniv: This is different from how custom-idents are used with other features<br>
&lt;fantasai> flackr: In other usages, we required a unique target for the custom ident. E.g. a scroll timeline produces a time from a single scroller, no way to combine<br>
&lt;fantasai> flackr: but with trigger events, no reason we can't collect trigger events from different sources<br>
&lt;TabAtkins> q+<br>
&lt;Rossen> ack DavidA<br>
&lt;fantasai> DavidA: Adopting this would mean that we have to attach multiple triggers to an animation<br>
&lt;DavidA> https://github.com/w3c/csswg-drafts/issues/12399#issuecomment-3109330018<br>
&lt;fantasai> DavidA: If that's true, I think we had a previous resolution to only support a single trigger per animation, would we need an update to that resolution?<br>
&lt;fantasai> flackr: No, doesn't require that.<br>
&lt;fantasai> flackr: This means that a single named trigger can have many sources that contribute events to it<br>
&lt;fantasai> flackr: For timeline triggers, it would mean that your trigger has many contributing timelines that each have their own thresholds of when they contribute their activation events etc.<br>
&lt;Rossen> fantasai: overall makes sense, esp for event triggers. For timeline triggers, one is start anim, the other<br>
&lt;ydaniv> qq+<br>
&lt;TabAtkins> fantasai: so how does that work? when you exit one of the timelines but not the other... do you want the intersection? or what?<br>
&lt;fantasai> flackr: When I created this issue, I had event triggers in mind.<br>
&lt;TabAtkins> flackr: I agree. when i created the issue i had event triggers in mind, where it's straightforward.<br>
&lt;fantasai> flackr: For timeline triggers, we very much depended on trigger state to do something meaningful<br>
&lt;fantasai> flackr: So would be supportive to say this is only for event triggers.<br>
&lt;Rossen> ack ydaniv<br>
&lt;Zakim> ydaniv, you wanted to react to DavidA<br>
&lt;Rossen> ack fantasai<br>
&lt;fantasai> ydaniv: [missed]<br>
&lt;TabAtkins> q-<br>
&lt;fantasai> ydaniv: If everything converges all things that use same ident for this trigger<br>
&lt;fantasai> ydaniv: and also the multiple triggers defined for that animation<br>
&lt;fantasai> ydaniv: if we merge all this comes to a single point, then it doesn't matter<br>
&lt;fantasai> flackr: For timeline triggers, only way this makes sense is if they each keep internal state of whether it's active or inactive<br>
&lt;fantasai> flackr: You don't want a situation where one timeline wants to activate but other wants to deactivate and you flip between them rapidly<br>
&lt;fantasai> ydaniv: So we also need a resolution to say that this only works for event triggers ...<br>
&lt;DavidA> q+<br>
&lt;fantasai> flackr: I don't know that we've thought about it enough.<br>
&lt;fantasai> flackr: but easy to do for event triggers<br>
&lt;fantasai> DavidA: With timeline triggers, where each timeline maintains its own state... that would basically be functionally equivalent to each instance of the event instatiates a trigger<br>
&lt;Rossen> ack DavidA<br>
&lt;fantasai> flackr: I don't know. Haven't thought through that question.<br>
&lt;TabAtkins> fantasai: I think doing this for events make sense, would support resolution<br>
&lt;Rossen> ack fantasai<br>
&lt;flackr> q+<br>
&lt;TabAtkins> fantasai: for timeline, needs more thought. might be ar easonable model for combining, not sure what it woudl be. would hold off until robert and yehonatan have time to think on it<br>
&lt;fantasai> flackr: There is one tricky bit, triggers exist in the same namespacing.<br>
&lt;fantasai> flackr: You could have a combination of timeline triggers and event triggers contributing activations and de-activations to the same named trigger. Should that work or not, idk<br>
&lt;fantasai> flackr: So to take the resolution, can't combine different types of triggers.<br>
&lt;fantasai> fantasai: Yeah, I think we start there. If we find a reasonable way to combine, we can change.<br>
&lt;fantasai> PROPOSED: Allow event triggers to combine.<br>
&lt;Rossen> ack flackr<br>
&lt;fantasai> PROPOSED: Allow event triggers with the same name to combine into a single named trigger.<br>
&lt;fantasai> RESOLVED: Allow event triggers with the same name to combine into a single named trigger.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13710#issuecomment-4128044742 using your GitHub account


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

Received on Wednesday, 25 March 2026 16:34:25 UTC