Performance: Custom keyframe animations
Custom keyframe animations affect the browser's paint and composite stages, impacting visual smoothness and interaction responsiveness.
@keyframes smoothTransform {
0% { transform: translateX(0); }
100% { transform: translateX(100px); }
}
.animate-transform {
animation: smoothTransform 2s infinite;
will-change: transform;
}@keyframes slowLayoutShift {
0% { width: 100px; }
100% { width: 200px; }
}
.animate-width {
animation: slowLayoutShift 2s infinite;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Animating width | None | 1 per frame | High (layout + paint) | [X] Bad |
| Animating transform | None | 0 | Low (composite only) | [OK] Good |
tailwind.config.js?extend.keyframes with percentage steps and CSS properties.extend.animation.extend: { keyframes: { fadeIn: { '0%': { opacity: '0' }, '100%': { opacity: '1' } } }, animation: { fadeIn: 'fadeIn 2s ease-in forwards' } }class="animate-fadeIn" to an element?extend: { keyframes: { spinSlow: { '0%': { transform: 'rotate(0deg)' }, '100%': { transform: 'rotate(360deg)' } } }, animation: { spinSlow: 'spinSlow 3s linear infinite' } }class="animate-spinSlow". What is the likely problem?tailwind.config.js require restarting the development server to apply.Pass the test and this pattern moves unknown