Missing tailwind utility classes in production files

Noticed that some utility classes from tailwind don’t get generated in the production css file. While developing locally it worked fine to use bg-white but when I deployed it’s missing. Running yarn build the bg-white class is generated, running yarn build:production and it’s gone.

Is this a a tailwind issue or sage? I scaffolded this project 1–2 weeks ago and it came with tailwind included.

Production builds apply PurgeCSS to remove unused CSS. If classes are disappearing, either they aren’t used in your project, or they’re used in a way that PurgeCSS can’t find. Tailwind has a good explanation of how this works and how to customize it: https://tailwindcss.com/docs/optimizing-for-production


This topic was automatically closed after 42 days. New replies are no longer allowed.