opacity property changes?The transition-opacity class applies transition effects only to the opacity property, making changes smooth when opacity changes.
transition-all affects all properties, transition-transform affects transform only, and transition-delay sets delay but not the transition itself.
duration-500 in Tailwind CSS?The class duration-500 sets the transition duration to 500ms, meaning the transition effect will take half a second to complete.
Delay controls when the transition starts, and timing function controls the speed curve.
<button class="bg-blue-500 text-white px-4 py-2 rounded transition-colors duration-300 hover:bg-blue-700">Click me</button>
<button class="bg-blue-500 text-white px-4 py-2 rounded transition-colors duration-300 hover:bg-blue-700">Click me</button>The transition-colors class makes color changes animate smoothly. The duration-300 sets the animation to 300ms. On hover, the background color changes from blue-500 to blue-700 smoothly.
Text color does not change, so option A is incorrect. The button does not fade out, so D is wrong.
The ease-in timing function makes the transition start slowly and speed up towards the end.
ease-out starts fast and slows down, ease-in-out starts and ends slow with faster middle, and linear moves at a constant speed.
The motion-reduce:transition-none class disables transitions for users who have set their system to prefer reduced motion, improving accessibility.
Removing all transitions (B) is not necessary and reduces design quality. Using short durations (C) still animates. Adding aria-hidden (D) hides content from screen readers, which is unrelated.