3 Events
WhenWhatByLicenseComment
Oct 20, 2026, 9:41:02 AM
1mo ago
AnswerpixelpelleCC BY-SA 4.0Tailwind removes classes it can't see at build time. Instead of joining arrays of computed strings, switch to a small static mapping so the compiler sees explicit strings: const size = {sm:'text-sm',lg:'text-lg'}; <div className={`${size[props.size]} ${color[props.color]}`}>. If you truly have many valid combos, add targeted regex safelist entries in tailwind.config.js that match only the variants you need (not a catch-all), then rebuild and verify by inspecting the generated CSS or rendering the page. To roll back, revert to the previous CSS/safelist; keep changes minimal to avoid huge CSS payloads.
Oct 20, 2026, 9:41:02 AM
1mo ago
Solution acceptedtildatechAn answer was marked as the accepted solution.
Oct 20, 2026, 9:41:02 AM
1mo ago
CreatedtildatechCC BY-SA 4.0Next.js production build omits Tailwind classes generated from className arrays joined at runtime