The transition-colors class applies transitions only to color-related properties like background-color and color. Other classes target different CSS properties.
transition-all do?transition-all does in Tailwind CSS.The transition-all class applies transitions to all CSS properties that can be animated, making any change smooth.
transform property?transform property.The correct class is transition-transform. Other options are invalid Tailwind classes and will not work.
transition-opacity duration-500 produce on an element?<div class="transition-opacity duration-500 opacity-100 hover:opacity-50 bg-blue-500 text-white p-4 rounded">Hover me</div>The transition-opacity class makes opacity changes smooth. The duration-500 sets the time to 0.5 seconds. So on hover, the opacity changes smoothly from 1 to 0.5.
Tailwind provides motion-safe and motion-reduce variants to respect user preferences. Using motion-safe:transition-all enables transitions only if the user allows motion, and motion-reduce:transition-none disables transitions if the user prefers reduced motion.