Explanation of the CSS custom properties
- –sd-animation: Specifies the animation name or type; here it’s
sd-fadeIn. - –sd-duration: Duration of the animation;
250msmeans a quarter of a second. - –sd-easing: Easing/timing function;
ease-inaccelerates from slow to fast.
How they might be used
- Define the custom properties on an element or :root:
css
:root {–sd-animation: sd-fadeIn; –sd-duration: 250ms; –sd-easing: ease-in;}
- Reference them in animation-related properties:
css
.element { animation-name: var(–sd-animation); animation-duration: var(–sd-duration); animation-timing-function: var(–sd-easing);}
- Example keyframes:
css
@keyframes sd-fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); }}
Notes
- p]:inline” data-streamdown=“list-item”>You can override them on specific elements to change animation per-component.
Leave a Reply