to

-sd-animation: sd-fadeIn; –sd-duration: 0ms; –sd-easing: ease-in;

This article explains the CSS custom properties shown in the title, what they do, when you might use them, and practical tips for implementing them in animations.

What these properties mean

  • -sd-animation: a custom property likely used to select or name an animation preset (here, sd-fadeIn), not a standard CSS property but useful in design systems or JS-driven animation frameworks.
  • –sd-duration: sets the animation duration. 0ms means the animation will effectively be instant.
  • –sd-easing: defines the timing function; ease-in starts slowly and speeds up.

How they’re typically used

Design systems and component libraries often use custom properties (CSS variables) as a mechanism to let components declare animation parameters that are consumed by a separate animation layer (CSS rules, JS, or a framework). Example patterns:

  1. Component declares variables:
css
.my-component {–sd-animation: sd-fadeIn;  –sd-duration: 250ms;  –sd-easing: ease-in;}
  1. Global animation handler reads the variables:
css
[data-anim*=“sd-fadeIn”] {  animation-name: fadeIn;  animation-duration: var(–sd-duration, 200ms);  animation-timing-function: var(–sd-easing, ease);  animation-fill-mode: both;}
  1. Keyframes:
css
@keyframes fadeIn {  from { opacity: 0; transform: translateY(6px); }  to { opacity: 1; transform: translateY(0); }}

Why the example in the title is odd

  • Setting –sd-duration: 0ms cancels the visual transition; the element will jump to the final state immediately, which defeats the purpose of a fade-in.
  • Using a custom property name with a single hyphen (-sd-animation) is allowed but unconventional; standard custom properties must begin with . The single-leading-hyphen name could be a legacy prefix or a non-standard token used by a specific tool.

When 0ms duration is useful

  • For accessibility toggles where you want motion reduced.
  • To disable animations by default and enable them conditionally via overrides or JS.
  • To ensure layout snap-in during initial render, then animate on subsequent interactions.

Best practices

  • Prefer prefixed custom properties for consistency: –sd-animation.
  • Provide sensible defaults when consuming variables: animation-duration: var(–sd-duration, 200ms);
  • Respect prefers-reduced-motion: set durations to 0ms when the user prefers reduced motion.
  • Use descriptive names for presets and document them in your design system.

Example: fade-in with reduced-motion support

css
.my-component {  –sd-animation: sd-fadeIn;  –sd-duration: 250ms;  –sd-easing: ease-in;}
@media (prefers-reduced-motion: reduce) {  .my-component { –sd-duration: 0ms; }}
[data-anim~=“sd-fadeIn”] {  animation-name: fadeIn;  animation-duration: var(–sd-duration, 250ms);  animation-timing-function: var(–sd-easing, ease-in);  animation-fill-mode: both;}

Summary

Those three declarations are likely part of a design-system animation API: -sd-animation names the preset, –sd-duration controls timing (0ms disables motion), and –sd-easing sets the timing curve. Use custom properties, provide defaults, and honor prefers-reduced-motion for a robust implementation.

Your email address will not be published. Required fields are marked *