Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-transitions-2] Spec text talks about **values** being transitionable & having particular "animation type", when it probably wants to talk about **properties** #8761

Open
dholbert opened this issue Apr 24, 2023 · 3 comments

Comments

@dholbert
Copy link
Member

dholbert commented Apr 24, 2023

I have a clarity/correctness nit with this spec text that was recently added to css-transitions-2.

Spec link:
https://drafts.csswg.org/css-transitions-2/#transition-property-property

Specifically this block of text:
69f4ac7#diff-a9fb88c817f0afdb3cb3e08c28315c1174ef4e5d7db3e09c7dffe49a4a5a59dbR87-R91

I'll quote the text in question (emphasis added):

In CSS Transitions Level 2, property values are transitionable unless they have an animation type that is not animatable. Values with a discrete animation type are transitionable, and flip at 50% progress (p = 0.5).

ISSUE:
This spec text is written as if values themselves might be transitionable-or-not, and as if they might have particular value-specific "animation type" (of "not animatable" or "discrete").

This doesn't quite make sense -- the "animation type" concept is associated with a CSS Property rather than with its values, as defined at https://drafts.csswg.org/web-animations-1/#animation-type (particularly in the case of the "not animatable" animation type).

SUGGESTED FIX:
@fantasai I think this paragraph should be rewritten to talk about the properties being transitionable and having a particular "animation type", rather than the values -- does that make sense? Or if there's value-specific subtlety that we're trying to lean into here, we should perhaps make that more apparent.

(Note that the immediate next paragraph talks about "transitionable properties" so I think that is the meaning we're going for -- "transitionable" being associated with properties-as-a-whole rather than values.)

@dholbert
Copy link
Member Author

dholbert commented Apr 24, 2023

This is particularly for the "not animatable" portion, which applies to a whole property.

"discrete" does have a bit more of a value-specific flavor; it's defined as a whole-property thing at https://drafts.csswg.org/web-animations-1/#animation-type , but the "by computed value" / "repeatable list" animation-types there do say "the property values combine as discrete" for some cases. I think that's what this new css-transitions-2 spec text is meaning to capture here when referencing "Values with a discrete animation type".

Here's some suggested possibly clearer/more-precise text for https://drafts.csswg.org/css-transitions-2/#transition-property-property , now distinguishing between "properties with a discrete animation type" vs. properties with other animation types which have values that "combine as discrete":

In CSS Transitions Level 2, properties are transitionable unless they have an animation type that is not animatable.
Properties with a discrete animation type are transitionable, and flip at 50% progress (p = 0.5).
More generally: for any transitionable property that has values that combine as discrete, these values transition by performing a flip at 50% progress (p = 0.5).

(Further bikeshedding welcome.)

@dholbert
Copy link
Member Author

dholbert commented Apr 24, 2023

Alternate replacement-text -- slightly more concise/direct though maybe slightly less human-friendly:

In CSS Transitions Level 2, properties are transitionable unless they have an animation type that is not animatable.
If a transitionable property has a discrete animation type for all of its values, or has certain value combinations that combine as discrete, then these values transition by performing a flip at 50% progress (p = 0.5).

@dholbert
Copy link
Member Author

dholbert commented May 5, 2023

(See also web-platform-tests/wpt#39871 which is about tests expecting values vs. properties-as-a-whole being transitionable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant