Tailwind CSS 5 lessons
  1. 1 Why utility classes won
  2. 2 The class vocabulary sign in to open
  3. 3 Keeping the markup readable sign in to open
  4. 4 Responsive and dark mode sign in to open
  5. 5 Build, size and shipping sign in to open
Course overview
Data: video · change

This lesson: 122KB

Tailwind CSS · Lesson 1 of 5

Why utility classes won

Understand the trade before you judge it.

Tailwind replaces writing CSS rules with composing small single purpose classes directly in your markup. A padding class, a flex class, a colour class. Your HTML gets longer and your stylesheet stops growing.

The first reaction is usually that this looks wrong, and the objection is reasonable: it is the opposite of the separation people were taught. Three things explain why it won anyway.

Naming things is genuinely hard. A large share of CSS effort goes into inventing class names, then remembering them, then discovering that the name no longer describes what the component does. Utilities remove that work entirely.

Deleting is safe. With a stylesheet, nobody dares remove a rule because something somewhere might use it, so stylesheets only ever grow. Delete a component in Tailwind and its styling goes with it, because the styling was never anywhere else.

The constraint is the point. Tailwind gives you a scale for spacing, type and colour. You pick from that scale rather than typing arbitrary numbers, and the result is more consistent than most hand written CSS, especially across a team.

The real costs are worth stating. The markup is noisy. It is harder to read at a glance. And it works properly only with a build step that scans your files and includes the classes it finds.

Where it is not the answer: a small static page, or a team that already has a working design system.

Lab — try it yourself

Rebuild one component you already styled, using utilities only. Compare the two versions and note which you would rather change in six months.

Check what you learned

Create your free BvLogic ID to take the quiz and record your score.

Create your BvLogic ID
Continue to lesson 2 Up next 2. The class vocabulary