Tailwind CSS: Modifiers

Modifiers allow you to only apply some specific Tailwind class if another condition happens.

One is hover: to apply a class only if you’re hovering the element with the mouse.

For example: hover:underline

The dark: modifier is super useful with applying dark mode.

You set any “base” class, for example bg-white, and then say dark:bg-black to “override” the first one in dark mode.

Modifiers are also super useful with response design, as you’ll see in the next lesson.

Lessons in this unit:

0: Introduction
1: Box model properties
2: Colors
3: Typography
4: Flexbox and Grid in Tailwind
5: ▶︎ Modifiers
6: Responsive design in Tailwind