7

What is the maximum value of duration in CSS transition-duration or transition-delay property? I can't find this information.

I found only that default value is 0s.

I used these documents:

  1. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions
  2. https://drafts.csswg.org/css-transitions/
  3. https://www.w3.org/TR/css3-transitions/
  4. https://drafts.csswg.org/css-values-3/#time-value
TylerH
  • 20,816
  • 57
  • 73
  • 92
Lukas M.
  • 2,719
  • 19
  • 30

1 Answers1

4

As Guruprasad J Rao mentioned, the longest transition-duration possible is the number of seconds contained within the largest integer possible, which happens to be 2147483647. If anybody is curious, a transition-duration of 2147483647s is 68.24 years (including leap years).

This sounds ridiculous, I agree. However, there actually are use cases for this. For example, in my own project, I ran into a problem where webkit didn't let me change the background color of their browser-implemented input autofill. Overriding via "!important" didn't work because browser-implement styles are impossible to override like that. So, to stop the webkit autofill from changing my input's colors, I just used transition: background-color 2147483647s. Problem solved.

John Miller
  • 371
  • 6
  • 13