user12457151
user12457151

Reputation: 1021

Why do some tailwind classes use "base" and some use "md"?

I am trying to differentiate between "base", "md", and no flag.

For example, in box shadows, tailwind provides:

Contrast this with text sizing:

Is there a practical reason for this? It's interesting that shadow has a size between small and medium, but for text, "base" seems to be the medium. Does "base" = "md"? Would love to know the origin of this terminology if anyone happens to know.

Upvotes: 2

Views: 213

Answers (1)

Johan
Johan

Reputation: 2962

the -base variant is applied to all text styles by default, so it serves as the base text style that other variations of text styles are derived from.

This allows you to customize the base text style by modifying the -base variant in your configuration file, and then all other text styles will inherit those.

-base only work with text, not other classes

About the other flags and no flag Tailwind provides these different sizes (depending on classes) to set different sizes :

  • xs
  • sm
  • md
  • lg
  • xl
  • 2xl

The no flag one is the 'default' one. It usualy occure between md and lg.

For example, to apply border-radius from smaller to larger : rounded-md > rounded > rounded-lg

Hope it helps

Upvotes: 1

Related Questions