Revisited global styles in a legacy React app.
π« Before:
- Global CSS: 240KB uncompressed
- No purging of unused styles β Fix:
- Switched to Tailwind w/
@layer
and@apply
- Enabled PurgeCSS in production
- Inlined above-the-fold critical styles π Result: CSS payload dropped to 288KB β‘ First Contentful Paint improved by ~400ms (Lighthouse) π‘ CSS doesn't need to be big to be powerful.
Top comments (0)