Understanding -sd-animation: sd-fadeIn; –sd-duration: 250ms; –sd-easing: ease-in;
This short CSS declaration group is a compact pattern for applying simple, reusable animations via custom properties and a small naming convention. Below is a clear explanation of each part, how they work together, and a minimal implementation you can use or adapt.
What each property does
- -sd-animation: names the animation preset to apply (here
sd-fadeIn), typically used by your stylesheet or JS to select an animation pattern. - –sd-duration: sets the animation duration (here
250ms). - –sd-easing: sets the timing function (here
ease-in).
Example: CSS setup and usage
Define base animation keyframes and a rule that maps the -sd-animation name to actual animation properties via custom properties:
css
:root {–sd-duration: 250ms; –sd-easing: ease-in;}
/* Example keyframes /@keyframes sd-fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); }}
/ Rule to apply the chosen animation name via the custom property
Leave a Reply