A Tailwind class works locally but disappears on production, why?

It was purged. Tailwind only keeps classes it can find by scanning the files listed in your tailwind.config.js content array. If a class is built dynamically in PHP, lives in a PHTML the scanner doesn’t cover, or is concatenated from strings, Tailwind never sees it and strips it from the production bundle. The fix is to add the path to content, safelist the class, or rebuild the class statically, then rebuild Tailwind. We catch these by diffing the DOM classes against the compiled app.css.

Kishan Savaliya
Kishan Savaliya
Adobe Certified Magento Commerce Developer
Ahmedabad [IN]working hours, replies within four hours
When do you need it

Read personally. Never shared. Or email the brief.

More on hyvä bug fixing

Need it fixed, not just explained?

Send the brief with your store URL; the written quote comes back within 24 hours.