Fireship · @fireship
Tailwind CSS is the worst…
Uploaded January 16, 2023 · Length 3:55
Summary
Fireship discusses the pros and cons of using Tailwind CSS, a popular CSS framework, and its trade-offs in project development.
- tailwind css
- css framework
- css development
- web development
- programming
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:01
it is January 16 2023 and you're
- 0:04
watching the code report Tailwind is the
- 0:06
worst way to do CSS except for all the
- 0:08
other ways that have been tried an epic
- 0:10
war erupted yesterday after somebody had
- 0:12
the audacity to post a Tailwind snippet
- 0:14
on Twitter the Allied Tailwind Alliance
- 0:16
defended this code while the unified CSS
- 0:18
fundamentalists said horrible
- 0:20
dehumanizing things about it like it's
- 0:22
not even real CSS as a result many
- 0:24
insecure nerds suffered slightly hurt
- 0:26
feelings from hearing mild criticisms
- 0:28
about technology choices that their
- 0:29
clients will never care about it was
- 0:31
truly horrific I decided to run a poll
- 0:33
to see where you guys fall and although
- 0:35
most have never tried it 4 out of five
- 0:36
people that have tried Tailwind love it
- 0:38
still though it has its trade-offs and
- 0:40
may not be a good fit for every project
- 0:41
in this video I want to explain the
- 0:43
problems Tailwind solves because it's
- 0:44
obvious that many people don't even
- 0:46
understand them yet still have no
- 0:47
problem hating on a free and open source
- 0:49
tool publicly I personally joined the
- 0:51
Tailwind Colt a couple years ago after
- 0:52
refusing to drink the Kool-Aid for quite
- 0:54
a while in my experience it's a tool
- 0:55
like typescript or svelte that makes it
- 0:57
really hard to go back to the thing you
- 0:59
were using before because it saves a ton
- 1:00
of time time and becoming a productive
- 1:02
developer is all about using your time
- 1:04
wisely the first problem with CSS is
- 1:06
co-location the standard practice for
- 1:08
the last 20 years has been to separate
- 1:10
your CSS from the markup to provide a
- 1:12
good separation of concerns and doing
- 1:14
otherwise means you go to hell as
- 1:15
programmers we know the hardest part of
- 1:16
the job is naming things and this
- 1:18
practice requires you to come up with a
- 1:20
lot of arbitrary names that are often
- 1:22
pointless a few weeks later when you
- 1:23
come back to modify this code it becomes
- 1:25
difficult to figure out which Styles
- 1:26
actually apply to each element because
- 1:28
you've totally forgotten what these
- 1:29
class names do and you might have used
- 1:31
these class names in multiple places so
- 1:33
if you try to change it it could break
- 1:34
unexpected parts of the UI Tailwind
- 1:36
addresses this problem by giving you
- 1:38
standard utility classes that are
- 1:40
co-located in the HTML this results in
- 1:42
disgusting bloated HTML that looks like
- 1:44
Blasphemous inline Styles at first
- 1:46
glance and that's a very valid criticism
- 1:48
and likely the main turn off for people
- 1:50
when they first look into using Tailwind
- 1:52
however the benefit is that you don't
- 1:53
have all these arbitrary class names
- 1:55
anymore and know exactly which Styles
- 1:57
apply to it and that just clears a ton
- 1:58
of mental overhead from your plate you


