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: github.com/dcastil/tailwind-m...
Enjoying my teaching style? I'm creating an independent Tailwind CSS course called Pro Tailwind. Check it out at 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!
Пікірлер: 173