Performance: Transition property selection
This affects how quickly and smoothly visual changes happen during user interactions, impacting rendering speed and visual stability.
transition-opacity duration-300 ease-in-out
transition-all duration-300 ease-in-out
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| transition-all | Style recalculation for all properties | Multiple recalculations per change | High paint cost due to broad repaints | [X] Bad |
| transition-opacity | Style recalculation only for opacity | Single recalculation per opacity change | Low paint cost focused on opacity | [OK] Good |
transition-colors specifically targets background color changes for smooth animation.transition-[property] to specify which CSS property to animate.transition-opacity. Other options are invalid or do not exist in Tailwind.class="transition-transform duration-500 ease-in-out" on a button that changes scale on hover?transition-transform enables smooth animation for CSS transform properties like scale, rotate, or translate.duration-500 sets the animation time to 500 milliseconds, and ease-in-out controls the speed curve for smooth start and end.class="transition-colors duration-300" but the background color changes instantly. What is the likely problem?transition-colors is valid and duration-300 sets 300ms duration, which is enough. Missing trigger is the issue.transition-colors and transition-opacity together.transition-all covers all properties, including these two, with one class.Pass the test and this pattern moves unknown