Performance: Purging unused styles
HIGH IMPACT
This affects page load speed by reducing CSS file size and improves rendering speed by minimizing style calculations.
/* Tailwind config with purge enabled */ module.exports = { content: ['./src/**/*.{html,js,jsx,ts,tsx}'], theme: { extend: {}, }, plugins: [], };
/* Tailwind config without purge */
module.exports = {
content: [],
theme: {
extend: {},
},
plugins: [],
};| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No purge (full Tailwind CSS) | Low (unaffected) | Low | High (large CSS causes slower paint) | [X] Bad |
| Purge unused styles enabled | Low (unaffected) | Low | Low (smaller CSS speeds paint) | [OK] Good |