What is Tailwind CSS?

Tailwind CSS is an open-source CSS framework that provides a set of low-level utility classes that you can use to build custom designs directly into your HTML.

Most CSS frameworks like Bootstrap come with predesigned components like buttons, cards, and navbars. While this makes it easy to build a website quickly, it also results in many websites that look identical and requires a lot of overriding with custom CSS when you want to deviate from the framework's design language.

Tailwind CSS takes a different approach. Instead of providing components, it provides utility classes for every CSS property. This allows you to build custom designs without having to write a single line of custom CSS.

The Utility-First Philosophy

Utility-first is a design philosophy that encourages the use of small, single-purpose classes to build complex user interfaces. Instead of writing custom CSS rules for every element, you use utility classes to apply styles directly to your HTML elements.

For example, to build a simple card with a shadow and rounded corners, you could use the following utility classes:

As a comparison, here's the code required to build the same card using traditional CSS:

Main Features of Tailwind CSS

In the next page, we'll see how to get Tailwind CSS up and running for your project.