Transition Example

suggest change

List the properties that should animate instead of using all:

.button {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.button:hover {
  transform: translateY(-0.125rem);
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

Explicit property names prevent unrelated future changes from being animated accidentally. Transforms and opacity are usually good animation choices because they often avoid layout work, but performance still depends on the page and browser.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents