-
What build tool are you using?
Describe the issueThis issue occurs only with one specific custom utility class: In development ( However, after running a production build ( Input Utility Class (index.css)
Expected Output (Preserved order in compiled CSS)
Actual Compiled Output (from production build)
🔁 ReproductionA minimal Vite + React + Tailwind CSS setup demonstrating the issue: 👉 View Reproduction Repository Why This Is a ProblemThe order of CSS properties — especially with animation shorthand and scroll-based animation properties like This issue does not occur in the development environment. Only the production CSS build reorders properties in this class. System Info
Additional ContextThis issue only affects this particular class: Would appreciate guidance on how to preserve property order in production or disable CSS reordering for certain utility classes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey! 👋 Thanks for the detailed reproduction — I ran into this exact issue recently too. You're 100% right that the problem comes from CSS property reordering in production, and more specifically from Vite's PostCSS/CSS optimizer — not Tailwind itself. Let me break it down and give you a clean workaround: 🔍 Root CauseIn production builds ( animation-timeline: view();
animation-range-start: cover;
animation-range-end: 400px; ...the order of ✅ Solution 1: Use
|
Beta Was this translation helpful? Give feedback.
Thanks for the thorough breakdown — totally agree with everything you said about how Vite’s production pipeline affects animation-* properties through reordering.
Just wanted to add:
I had already tried the longhand approach (splitting animation-name, animation-range-start, etc.), which helped partially, but I was still seeing inconsistent behavior in production — likely due to post-processing interference.
Since I didn’t want to disable minification (keeping bundle size lean is still a priority), the workaround that ended up working for me was:
✅ Moving the fadeIn animation utility into a standalone CSS file that’s not processed by Tailwind/PostCSS — just a regular CSS file imported into…