This rule raises an issue when a transition uses all, either explicitly or by omitting the property name.
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.
Replace all with opacity when the intended interaction is a fade.
.element {
transition: all 200ms; /* Noncompliant: "all" animates every property that changes */
}
.element {
transition: opacity 200ms;
}
Omitting the property name also animates all. Name transform when the interaction moves, scales, or rotates the
element.
.element {
transition: 200ms; /* Noncompliant: no property is named, so "all" is used */
}
.element {
transition: transform 200ms;
}
The same applies to the transition-property longhand.
.element {
transition-property: all; /* Noncompliant: "all" animates every property that changes */
transition-duration: 200ms;
}
.element {
transition-property: opacity;
transition-duration: 200ms;
}
In a list, name the property in each entry that uses all.
.element {
transition: all 200ms ease, opacity 100ms; /* Noncompliant: the first entry animates "all" */
}
.element {
transition: background-color 200ms ease, opacity 100ms;
}
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:
all entry is zero or omitted.inherit or unset.var(), a preprocessor variable, or interpolation.transition-duration, without a transition or transition-property declaration.@mixin, @include, or @if in SCSS.@include in SCSS or .mixin(); in Less, follows the declaration in the same block, because the
mixin may override the transition..fade-enter-active or .fade-leave-to. Vue applies
these classes only while an element enters or leaves, so other style changes are not affected.When animating every property is intentional, mark the issue as accepted and add a comment that explains why.
transition-property