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

Published: 30 May 2023
on channel: 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


Watch video Tailwind-Merge Is Incredibly Useful — And Here's Why! online without registration, duration hours minute second in high quality. This video was added by user simonswiss 30 May 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 36,652 once and liked it 1.4 thousand people.