-
Notifications
You must be signed in to change notification settings - Fork 707
[css-properties-values-api-1] Allow customizing property animation interpolation curve #5920
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
Comments
Well this brings up the question of whether the rules for interpolating That said, the larger point of allowing more customizeable control over property animations is legit. This is tied into the earlier "apply hook" ideas (still captured in a draft document in the Houdini repo, not served publicly), letting authors control how a property went from specified->computed. |
I'm not sure that we shouldn't have property specific interpolation overrides. Imagine that we didn't have ratios defined yet, the developer could define aspect-ratio as a regular number type but give it logarithmic interpolation. |
I agreed with that in the previous comment, yeah. ^_^ |
Sorry, I think I may have misunderstood. Just to make sure I'm following because I think what you said solves the problem of interpolation but has a slight difference from what I said: I think you're suggesting the dev could have an apply hook which would convert the specified --user-aspect-ratio property into its logarithm in the computed style? However, I think this would mean reading the computed value would then give you the log of the aspect ratio, right? Or do apply hooks allow devs to define how the computed value is read back? |
I'm saying that animated value and computed value are very close concepts (in the cascade and semantically), and we already have some early attempts at letting authors customize computed values of custom properties, so letting them customize animated values also makes sense. |
In #4953 we decided that ratios should be interpolated using a log curve to avoid asymmetric acceleration as the aspect ratio division result approaches 0 (i.e. make aspect ratio interpolation visually appear linear regardless of whether interpolating to/from a narrow or wide aspect ratio). In the blink intent thread it was brought up that having a one-off different interpolation curve for aspect-ratio seemed strange and that we should consider allowing customization of this.
Defining the implicit interpolation curve for a new property might be a good fit as part of a PropertyDefinition to allow developers to define other properties where the default linear interpolation curve doesn't make sense.
The text was updated successfully, but these errors were encountered: