Transition
Generate transition strings without repetitive typing.
This function allows you to have a default timing function and duration over your entire app, while still allowing for customized values when needed.
Usage
Parameters
The generateTransition function accepts only one options parameter used to set the default values. It can have the following properties.
Default options
Custom defaults
You can define you own defaults but passing the options object into the generate function.
Transition function
The transition is the result of the generator function. You have to call it to get an actual transition string as output and it can be used throughout your app.
If called without parameters it will return the default values as shown above, but it can accept up to three parameters, cssProperties
, duration
, easing
.
Custom overrides
You can override the default options in any call to the transition
function. It will automatically joins two or more transitions if they are present.
You may also input the timing function as the second parameter, doing so will use the default duration.
Last updated