Those look like custom CSS properties and a utility class controlling a simple fade-in animation. Summary:
- -sd-animation: sd-fadeIn; — a custom property (or shorthand) indicating the animation name to apply.
- –sd-duration: 250ms; — custom property specifying the animation duration (250 milliseconds).
- –sd-easing: ease-in; — custom property specifying the timing function (acceleration at end).
Example usage (how these tie together):
- Define the keyframes:
@keyframes sd-fadeIn {from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); }} - Apply via a class that reads the custom properties:
.sd-animated { animation-name: var(-sd-animation); animation-duration: var(–sd-duration); animation-timing-function: var(–sd-easing); animation-fill-mode: both;}
Notes:
- Use consistent custom property names: CSS variables must start with two dashes (e.g., –sd-animation). A single leading dash (-sd-animation) is invalid as a custom property.
- Fallbacks: provide defaults with var(–x, fallback).
-
@media (prefers-reduced-motion: reduce) { .sd-animated { animation: none; transition: none; }}
Leave a Reply