- From: Yehonatan Daniv via GitHub <noreply@w3.org>
- Date: Sat, 14 Jun 2025 15:54:29 +0000
- To: public-css-archive@w3.org
> TLDR; I propose we have new prefixes that independent from the animation-* longhands for creating named triggers, e.g. timeline-trigger-* combined with a dashed-ident name that can be referenced from the animation-trigger property on an animation (similar to referencing an animation-timeline). I've thought about this a few times in the past, declaring triggers separately using an ident, and then referencing that ident from animations, but it seems to me that this only needlessly complicates the feature without adding any benefit to authors. WIth the current syntax you have the following references: `animation.trigger -> timeline`. With the proposed change you'll have: `animation -> trigger -> timeline`. And if we consider all names are tree-scoped, then we may need to jump through 2 scope-lifting hoops in some cases. I strongly feel this makes the API much more complicated and without any additional benefit. I understand we have technical problems overloading/expanding the syntax of `animation-trigger` to also accommodate event-based triggers, but we shouldn't sacrifice reaching a good design over technical issues. Another way to escape the double reference would be to make trigger declaration an at-rule, but this also seems like an unnecessary complication to the model. The problems we're facing now are: - How to overload `animation-trigger` to allow singular events along with timelines. - How to declare those events on elements. For example, we could do something like adding a longhand like `animation-trigger-event`, which when set, renders `animation-trigger-timeline` to `none`. Since `-timeline` already accepts a dahsed-ident we could wrap that in an `event()` function. Then we need to decide on something like adding a `trigger-event` property which allows setting a list of events. -- GitHub Notification of comment by ydaniv Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-2972844609 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 14 June 2025 15:54:30 UTC