This rule raises an issue when a transition uses all, either explicitly or by omitting the property name.

Why is this an issue?

With all, every animatable property whose value changes is animated, including properties added in later edits and values that change for other reasons, such as a color set by a theme or a width set by a media query. These animations were never intended, can look like visual glitches, and can make the page stutter when layout properties such as width or height animate.

Replace all with the properties that the interaction is meant to animate, and keep the existing durations, delays, and timing functions in the same order. When several properties should animate, list each of them, for example transition: opacity 200ms, transform 200ms. Setting the duration to 0s or the property to none disables the transition, so it is not a fix for an interaction that needs animation.

The rule checks each declaration block on its own and does not follow the cascade across selectors or files. It covers CSS, <style> blocks in HTML and Vue files, and SCSS, Sass, and Less files.

Code examples

Replace all with opacity when the intended interaction is a fade.

Noncompliant code example

.element {
  transition: all 200ms; /* Noncompliant: "all" animates every property that changes */
}

Compliant solution

.element {
  transition: opacity 200ms;
}

Omitting the property name also animates all. Name transform when the interaction moves, scales, or rotates the element.

Noncompliant code example

.element {
  transition: 200ms; /* Noncompliant: no property is named, so "all" is used */
}

Compliant solution

.element {
  transition: transform 200ms;
}

The same applies to the transition-property longhand.

Noncompliant code example

.element {
  transition-property: all; /* Noncompliant: "all" animates every property that changes */
  transition-duration: 200ms;
}

Compliant solution

.element {
  transition-property: opacity;
  transition-duration: 200ms;
}

In a list, name the property in each entry that uses all.

Noncompliant code example

.element {
  transition: all 200ms ease, opacity 100ms; /* Noncompliant: the first entry animates "all" */
}

Compliant solution

.element {
  transition: background-color 200ms ease, opacity 100ms;
}

Exceptions

When a block sets a transition more than once, only the values that take effect are checked, as in the browser. The rule does not report a transition when:

When animating every property is intentional, mark the issue as accepted and add a comment that explains why.

Resources

Documentation