Tailwind provides you with numerous built-in utilities. These utilities typically create a CSS property and value pair.
Here are some basic examples:
| Tailwind | CSS |
|---|---|
p-4 |
padding: 1rem |
m-8 |
margin: 2rem |
object-cover |
object-fit:cover |
This 1-1 pairing creates an illusion that Tailwind utilities are simply a substitute for CSS properties. But it’s only an illusion.
Tailwind’s utilities can be way more powerful — they can adjust multiple CSS property:value pairs — but you’ll have to do that with your custom utilities.
/* vertical creates 2 css declarations */@utility vertical { display: flex; flex-direction: column;}We’ll cover a lot more about custom Tailwind utilities in the Unorthodox Tailwind chapter. But before we dive further into Tailwind utilities — and the power they hold — you have to understand the utilities that Tailwind comes with.
So the next two lessons are dedicated to help you quickly internalize Tailwind’s seemingly simple yet complex, and sometimes conflicting, utility system.
Welcome! Unfortunately, you don’t have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson