-
Notifications
You must be signed in to change notification settings - Fork 77
CSS transitions
JC Franco edited this page Aug 17, 2024
·
1 revision
We have a few components using idle
and active
(or similarly named) CSS classes to match a pattern commonly used in transition libs to ensure transitions are run consistently. Maquette has a great breakdown of how this works:
The best way to explain this technique is through an example. Let us say an element with the enterAnimation "slideUp" is added, then the following happens:
- The CSS class "slideUp" is added to the element
- Immediately afterwards, the CSS class "slideUp-active" gets added.
- The browser waits until a CSS transition finishes on the element
- Both CSS classes are removed again.
Worth noting that slideUp
represents the idle
class in our case.