The function takes two arguments — the node to which the transition is applied, and any parameters that were passed in — and returns a transition object which can have the following properties:
delay
— milliseconds before the transition beginseasing
— a easing function (see the chapter on )tick
— a function that has some effect on the node
Most of the time you should return the css
property and not the property, as CSS animations run off the main thread to prevent jank where possible. Svelte ‘simulates’ the transition and constructs a CSS animation, then lets it run.
We can get a lot more creative though. Let’s make something truly gratuitous: