Tailwind CSS: The Good, The Bad, The Ugly
Tailwind CSS delivers unmatched development velocity for UI prototyping and shipping fast, but it creates a readability problem at scale. A single button component can accumulate 15+ utility classes, making the JSX nearly impossible to review in code review. The solution is a three-layer approach. First, use tailwind-merge and clsx together to conditionally join classes without specificity conflicts — this eliminates the 'which padding wins?' problem when composing variants. Second, extract frequently repeated patterns into CSS using @apply in a dedicated components layer, keeping your JSX clean while preserving Tailwind's design tokens. Third, establish a team convention: any element with more than 8 utility classes gets extracted into a named component or @apply block. On a 40+ page consulting site build, this approach reduced average JSX line length by 35% and cut code review time significantly. The key insight: Tailwind is a styling engine, not a replacement for CSS architecture. Treat it as a low-level tool and build abstractions on top. Source: client project for Ace Infinity, 2026.