Tailwind-Merge Is Incredibly Useful — And Here's Why!

Опубликовано: 30 Май 2023
на канале: simonswiss
36,652
1.4k

In this video, I walk you through an often underestimated problem that arises when composing Tailwind CSS styles by passing a className prop to a component.

And show you why tailwind-merge is an excellent tool to work around those issues.

Instead of teaching you tailwind-merge works, I teach you why it is so useful.

Links

tailwind-merge: https://github.com/dcastil/tailwind-m...

Enjoying my teaching style? I'm creating an independent Tailwind CSS course called Pro Tailwind. Check it out at https://protailwind.com ❤️

Chapters

0:00 Introduction
0:11 Contrived example
0:29 Naive override attempt
1:45 Homemade merge function
2:41 A sneaky source order problem
4:05 Another specificity clash example
5:48 Tailwind Intellisense warning
7:07 The need for tailwind-merge
7:33 The clsx library
8:36 The tailwind-merge library
9:29 The twJoin utility
9:52 The twMerge utility, finally
11:24 Support for state modifiers
12:14 Tailwind merge documentation
12:33 Outro


Смотрите видео Tailwind-Merge Is Incredibly Useful — And Here's Why! онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь simonswiss 30 Май 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 36,652 раз и оно понравилось 1.4 тысяч людям.