|
1 | 1 | :where(html) {
|
| 2 | + |
| 3 | + /* Animation duration based on https://design.brainly.com/8adfd5f36/p/091f75-ux-motion */ |
| 4 | + --duration-instant: 0ms; /* e.g. text change */ |
| 5 | + --duration-quick-1: 80ms; /* e.g. checkbox, radio, hover */ |
| 6 | + --duration-quick-2: 120ms; /* e.g. toggle, tab, chip, color, fade */ |
| 7 | + --duration-moderate-1: 180ms; /* e.g. dropdown, tooltip */ |
| 8 | + --duration-moderate-2: 260ms; /* e.g. modal, toast, dialog, notification */ |
| 9 | + --duration-gentle-1: 320ms; /* e.g. bottom sheet, card expand */ |
| 10 | + --duration-gentle-2: 420ms; /* e.g. advanced animations */ |
| 11 | + |
| 12 | + /* |
| 13 | + * Calculated animation duration based on https://design.brainly.com/8adfd5f36/p/091f75-ux-motion/t/page-091f75-75547432-5018fa-12 |
| 14 | + * Demo: https://codepen.io/T3sT3ro/pen/RNwRLWx |
| 15 | + * unitless |
| 16 | + */ |
| 17 | + --animated-element-distance: 0; |
| 18 | + --animated-element-width: 0; |
| 19 | + --animated-element-height: 0; |
| 20 | + |
| 21 | + /* Calculated animation duration in milliseconds */ |
| 22 | + --duration-calculated: calc(((0.5 * var(--animated-element-distance, 0)) + |
| 23 | + (0.35 * var(--animated-element-width, 0)) + |
| 24 | + (0.3 * var(--animated-element-height, 0))) * 1ms); |
| 25 | + |
| 26 | + /* Common time units */ |
2 | 27 | --minute: 60s;
|
3 | 28 | --hour: calc( 60 * var(--minute));
|
4 | 29 | --day: calc( 24 * var(--hour));
|
|
0 commit comments