Danoosh Jooybar
Danoosh Jooybar

Reputation: 79

What is base in tailwind config used for?

I was wondering what could be configured in tailwind config file, I just can not grasp what could be configured in this file, specially the base part.

@tailwind base;

@tailwind components;

@tailwind utilities;

Could anybody elaborate this?

Upvotes: 1

Views: 3698

Answers (1)

mhhabib
mhhabib

Reputation: 3121

Using the @tailwind means to insert Tailwind’s directive. Tailwind supports these four directives base, components, utilities, and screens styles into your CSS.

Base injects Tailwind's base styles like inserting any layout theme etc. Details use of the base

@layer base {
  h1 {
    @apply text-2xl;
  }
  h2 {
    @apply text-xl;
  }
}

Similarly, components work for extracting some classes like buttons. You can go through all this for getting hints

Upvotes: 5

Related Questions