TwTailwind CSS · Lesson 1 of 8
The Utility-First Approach
Traditional CSS: you write a class name, then write CSS for it. Tailwind: the class names ARE the CSS. `p-4` means `padding: 1rem`. `text-blue-500` means that specific blue. No naming, no context-switching, no files.
Tailwind classes are atomic utilities — each does exactly one thing. You compose them directly in your HTML to build any design. This feels weird for about two hours and then feels obviously correct.
◆ Note
Tailwind's build process scans your HTML/JS files and includes only the CSS classes you actually use. The final CSS bundle is typically 5–15 KB, not the full framework. This is why you must configure the `content` paths in tailwind.config.js — Tailwind needs to find all your class names.
Tailwind's build process scans your HTML/JS files and includes only the CSS classes you actually use. The final CSS bundle is typically 5–15 KB, not the full framework. This is why you must configure the `content` paths in tailwind.config.js — Tailwind needs to find all your class names.