Skip to content

[css-transitions-2] Start transitions on discrete animation types #4441

Closed

Description

Image for: Description

One of the goals of web-animations is to allow developers to define custom transitions. In theory, this would let a developer define a transition for property types which are animation type Discrete, however css-transitions-1 defines discrete animations as not transitionable:

https://drafts.csswg.org/css-transitions-1/#starting

When comparing the before-change style and after-change style for a given property, the property > values are transitionable if they have an animation type that is neither not animatable nor discrete.

This issue is to explore the possibility of allowing developers to create custom transitions for such properties. Since a lot of content today likely relies on the current behavior (transition-property: all is a very common pattern), any solution would likely have to preserve the existing visual behavior

Option 1 - Use custom easing on discrete transitions

We could define transitions on discrete properties to create a transition using an easing type which immediately assumes the end value. This would preserve the existing visual behavior while allowing developers to listen for and modify the transition.

However, if we assume that a lot of existing comment has transition: all >0 duration, doing all of the work to create and run these transitions may be prohibitively expensive.

Option 2 - Start and cancel discrete transitions

Start the transition animation, and immediately cancel it, such that a developer could access it and play it / modify it from a transitionstart event?

Metadata

Image for: Metadata

Metadata

Image for: Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Image for: Issue actions