- From: Robert Flack via GitHub <noreply@w3.org>
- Date: Tue, 29 Jul 2025 15:39:27 +0000
- To: public-css-archive@w3.org
Mostly the direction proposed above sounds good, however I have one concern. Specifically in the issues section of https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-3091201201 and in https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-3129952281 we agree that event triggers don't have a conceptual start/stop event, but we have heavily baked the concept of start/stop events into the api. If we consider an API where `start` and `end` (or for timeline triggers perhaps most appropriately `enter` and `exit`) are just named events rather than intrinsic parts of a trigger, we might get something that is much simpler for event based triggers at the same time. E.g. with start/stop if we want click to play an animation we have to do the following: ```css .target { animation: anim 5s; /* Choice of start or end seems arbitrary given we define the action to be taken.*/ event-trigger-start-type: click; event-trigger-name: --click; animation-start-trigger-event: --click; animation-start-trigger-action: play; } ``` However, perhaps we treat event trigger as a source that conceptually provides all events with their corresponding names: ```css .target { animation: anim 5s; /* Event trigger is no longer for a specific event or pair of events, but merely identifies the event target */ event-trigger-name: --source; animation-start-trigger-event: --source click; animation-start-trigger-action: play; } ``` And with timeline triggers the events could be enter and exit to correspond conceptually to their ranges: ```css .target { animation: anim 5s; /* Event trigger is no longer for a specific event or pair of events, but merely identifies the event target */ timeline-trigger-name: --source; timeline-trigger-source: view(); animation-start-trigger-event: --source enter; animation-start-trigger-action: play; } ``` This way we aren't special casing start and stop and making developers choose some events to map to these things. I think with events as @szager-chromium mentioned you may not want the trigger to have to be in the active state to respond to the other event. However, if we think event triggers should not fire an end event before the start event, then I think having start / end seems reasonable. -- GitHub Notification of comment by flackr Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-3133075898 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 29 July 2025 15:39:27 UTC