coderef

transition-behaviorBaseline · Newly available

The transition-behavior: allow-discrete CSS declaration allows transitions for properties whose animation behavior is discrete. Such properties can't be interpolated and swap from their start value to the end value at 50%.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Aug 6, 2024.

Browser support

DesktopChrome
1–116Not supported
117+Supportedsince Sep 12, 2023
Current: 155
Edge
12–116Not supported
117+Supportedsince Sep 15, 2023
Current: 154
Firefox
1–128Not supported
129+Supportedsince Aug 6, 2024
Current: 157
Safari
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27
MobileChrome Android
18–116Not supported
117+Supportedsince Sep 12, 2023
Current: 155
Firefox Android
4–128Not supported
129+Supportedsince Aug 6, 2024
Current: 157
Safari iOS
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Aug 6, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: transition-behavior.

Feature detection

CSS · check before using
@supports (transition-behavior: initial) {
  /* styles that rely on transition-behavior */
}

/* or in JavaScript */
if (CSS.supports("transition-behavior", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
transition-behavior11711712917.411712917.4
transition.transition-behavior11711712917.411712917.4