Performance: JIT mode and on-demand generation
HIGH IMPACT
This affects the CSS bundle size and page load speed by generating only the styles actually used in the HTML at build or runtime.
/* Tailwind JIT mode enabled in config */ module.exports = { mode: 'jit', purge: ['./src/**/*.{html,js}'], // other config };
/* Tailwind classic mode: all styles generated upfront */
@tailwind base;
@tailwind components;
@tailwind utilities;| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Classic Tailwind (all styles) | Low (CSS only) | 1 (initial load) | High (large CSS paint) | [X] Bad |
| Tailwind JIT mode | Low (CSS only) | 1 (initial load) | Low (small CSS paint) | [OK] Good |