Fireship · @fireship

Tailwind CSS is the worst…

Uploaded January 16, 2023 · Length 3:55

Tailwind CSS is the worst…

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.

  1. 0:01

    it is January 16 2023 and you're

  2. 0:04

    watching the code report Tailwind is the

  3. 0:06

    worst way to do CSS except for all the

  4. 0:08

    other ways that have been tried an epic

  5. 0:10

    war erupted yesterday after somebody had

  6. 0:12

    the audacity to post a Tailwind snippet

  7. 0:14

    on Twitter the Allied Tailwind Alliance

  8. 0:16

    defended this code while the unified CSS

  9. 0:18

    fundamentalists said horrible

  10. 0:20

    dehumanizing things about it like it's

  11. 0:22

    not even real CSS as a result many

  12. 0:24

    insecure nerds suffered slightly hurt

  13. 0:26

    feelings from hearing mild criticisms

  14. 0:28

    about technology choices that their

  15. 0:29

    clients will never care about it was

  16. 0:31

    truly horrific I decided to run a poll

  17. 0:33

    to see where you guys fall and although

  18. 0:35

    most have never tried it 4 out of five

  19. 0:36

    people that have tried Tailwind love it

  20. 0:38

    still though it has its trade-offs and

  21. 0:40

    may not be a good fit for every project

  22. 0:41

    in this video I want to explain the

  23. 0:43

    problems Tailwind solves because it's

  24. 0:44

    obvious that many people don't even

  25. 0:46

    understand them yet still have no

  26. 0:47

    problem hating on a free and open source

  27. 0:49

    tool publicly I personally joined the

  28. 0:51

    Tailwind Colt a couple years ago after

  29. 0:52

    refusing to drink the Kool-Aid for quite

  30. 0:54

    a while in my experience it's a tool

  31. 0:55

    like typescript or svelte that makes it

  32. 0:57

    really hard to go back to the thing you

  33. 0:59

    were using before because it saves a ton

  34. 1:00

    of time time and becoming a productive

  35. 1:02

    developer is all about using your time

  36. 1:04

    wisely the first problem with CSS is

  37. 1:06

    co-location the standard practice for

  38. 1:08

    the last 20 years has been to separate

  39. 1:10

    your CSS from the markup to provide a

  40. 1:12

    good separation of concerns and doing

  41. 1:14

    otherwise means you go to hell as

  42. 1:15

    programmers we know the hardest part of

  43. 1:16

    the job is naming things and this

  44. 1:18

    practice requires you to come up with a

  45. 1:20

    lot of arbitrary names that are often

  46. 1:22

    pointless a few weeks later when you

  47. 1:23

    come back to modify this code it becomes

  48. 1:25

    difficult to figure out which Styles

  49. 1:26

    actually apply to each element because

  50. 1:28

    you've totally forgotten what these

  51. 1:29

    class names do and you might have used

  52. 1:31

    these class names in multiple places so

  53. 1:33

    if you try to change it it could break

  54. 1:34

    unexpected parts of the UI Tailwind

  55. 1:36

    addresses this problem by giving you

  56. 1:38

    standard utility classes that are

  57. 1:40

    co-located in the HTML this results in

  58. 1:42

    disgusting bloated HTML that looks like

  59. 1:44

    Blasphemous inline Styles at first

  60. 1:46

    glance and that's a very valid criticism

  61. 1:48

    and likely the main turn off for people

  62. 1:50

    when they first look into using Tailwind

  63. 1:52

    however the benefit is that you don't

  64. 1:53

    have all these arbitrary class names

  65. 1:55

    anymore and know exactly which Styles

  66. 1:57

    apply to it and that just clears a ton

  67. 1:58

    of mental overhead from your plate you