Tailwind CSS is a utility-first CSS framework. Instead of writing custom CSS classes like .card and .button , you style elements directly in your HTML with small utility classes like p-4 , bg-blue-500 , and rounded-lg . It feels strange for about ten minutes, and then it feels faster than anything else.
How does it work? You add Tailwind to your project, then write classes in your markup. Each class does one small thing β padding, colour, font size, layout β and you combine them to build any design. When you build for production, Tailwind scans your files and generates only the CSS you actually used, so the final stylesheet stays tiny.
<!-- A card, styled entirely with utilities --> <div class = "max-w-sm rounded-lg bg-white p-6 shadow-md" > <h2 class = "text-xl font-bold text-gray-900" > Hello, Tailwind </h2> <p class = "mt-2 text-gray-600" > No separate CSS file needed.β¦