These are CSS custom properties (variables) likely used by a design system or component library to control an animation. Explanation:
- -sd-animation: sd-fadeIn;
- Selects the animation type or keyframe set named “sd-fadeIn”. The component or stylesheet uses this variable to decide which animation to apply (e.g., fading opacity from 0 → 1).
- –sd-duration: 250ms;
- Duration of the animation: 250 milliseconds.
- –sd-easing: ease-in;
- Timing function controlling animation acceleration: “ease-in” starts slowly and speeds up.
How they’re typically used in CSS:
- Define defaults on a component or :root:
:root {–sd-animation: sd-fadeIn; –sd-duration: 250ms; –sd-easing: ease-in;} - Apply to an element by referencing variables and mapping them to animation properties:
.anim { animation-name: var(–sd-animation); animation-duration: var(–sd-duration); animation-timing-function: var(–sd-easing); animation-fill-mode: both;} @keyframes sd-fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); }}
Tips:
- Use
animation-delay,animation-iteration-count, andanimation-fill-modeas needed. - For complex systems, consider using
@property(where supported) for typed custom properties.
Leave a Reply