A place to cache linked articles (think custom and personal wayback machine)
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.html 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  4. <!-- Has to be within the first 1024 bytes, hence before the `title` element
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>Classic rock, Mario Kart, and why we can’t agree on Tailwind (archive) — David Larlet</title>
  13. <meta name="description" content="Publication mise en cache pour en conserver une trace.">
  14. <!-- That good ol' feed, subscribe :). -->
  15. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  16. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  17. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  18. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  19. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  20. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  21. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  22. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  23. <meta name="msapplication-TileColor" content="#f7f7f7">
  24. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  25. <meta name="theme-color" content="#f7f7f7" media="(prefers-color-scheme: light)">
  26. <meta name="theme-color" content="#272727" media="(prefers-color-scheme: dark)">
  27. <!-- Is that even respected? Retrospectively? What a shAItshow…
  28. https://neil-clarke.com/block-the-bots-that-feed-ai-models-by-scraping-your-website/ -->
  29. <meta name="robots" content="noai, noimageai">
  30. <!-- Documented, feel free to shoot an email. -->
  31. <link rel="stylesheet" href="/static/david/css/style_2021-01-20.css">
  32. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  34. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  35. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  36. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  37. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  38. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  39. <script>
  40. function toggleTheme(themeName) {
  41. document.documentElement.classList.toggle(
  42. 'forced-dark',
  43. themeName === 'dark'
  44. )
  45. document.documentElement.classList.toggle(
  46. 'forced-light',
  47. themeName === 'light'
  48. )
  49. }
  50. const selectedTheme = localStorage.getItem('theme')
  51. if (selectedTheme !== 'undefined') {
  52. toggleTheme(selectedTheme)
  53. }
  54. </script>
  55. <meta name="robots" content="noindex, nofollow">
  56. <meta content="origin-when-cross-origin" name="referrer">
  57. <!-- Canonical URL for SEO purposes -->
  58. <link rel="canonical" href="https://joshcollinsworth.com/blog/tailwind-is-smart-steering">
  59. <body class="remarkdown h1-underline h2-underline h3-underline em-underscore hr-center ul-star pre-tick" data-instant-intensity="viewport-all">
  60. <article>
  61. <header>
  62. <h1>Classic rock, Mario Kart, and why we can’t agree on Tailwind</h1>
  63. </header>
  64. <nav>
  65. <p class="center">
  66. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  67. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  68. </svg> Accueil</a> •
  69. <a href="https://joshcollinsworth.com/blog/tailwind-is-smart-steering" title="Lien vers le contenu original">Source originale</a>
  70. </p>
  71. </nav>
  72. <hr>
  73. <p>When my brother and I were younger, our tastes in music were nearly polar opposites. I was a total hipster, and valued what I saw as artistic integrity and creative innovation. I was almost entirely into new and active, of-the-moment artists.</p>
  74. <p>In contrast, my brother made virtually no judgments at all. He was open to anything and everything, but his mainstays centered on classic rock of the ’70s and ’80s. He loved rediscovering decades-old albums by many of the most well-known artists of their time.</p>
  75. <p>Like any good elitist snob, I hated anything popular. So naturally, my brother’s kind of music was anathema to me at the time.</p>
  76. <p>My brother never really understood what it was I seemed to dislike so strongly. So finally, one day, he asked me.</p>
  77. <p>I thought about the question for a minute, and then summarized: “it’s all style and no substance.”</p>
  78. <p>He burst out laughing.</p>
  79. <p>“That’s the <em>best</em> thing about it!” he said with a huge grin. “That’s the whole point!”</p>
  80. <p>I knew we looked at the same things in opposite ways. But I had never realized before then that, wildly enough, we had <em>all the exact same reasons</em> for it.</p>
  81. <h2 id="we-dont-disagree-where-we-think-we-do"><a aria-hidden="true" tabindex="-1" href="#we-dont-disagree-where-we-think-we-do"><span class="icon icon-link"></span></a>We don’t disagree where we think we do</h2>
  82. <p>Tailwind is nearly as ubiquitous as it is polarizing these days. (I trust if you’ve been interested enough to read this far, I don’t need to cite any sources there.)</p>
  83. <p>Proponents show a near cult-like devotion to Tailwind, some even going so far as to claim it’s “fixed” CSS—or at the very least, made it manageable and predictable in a way it wasn’t for them before. Most frontend frameworks and products feature a first-class Tailwind integration, due to its soaring popularity.</p>
  84. <p>Detractors, on the other hand, claim Tailwind is messy; it gets in the way; it violates core fundamentals of web development; it cuts against the grain; it diminishes the power of CSS; and/or that it does the <em>opposite</em> of what it’s supposed to, adding complexity and making projects even <em>harder</em> to maintain.</p>
  85. <p>Many who use Tailwind never want to go back; many who <em>don’t</em> never want to.</p>
  86. <p>How could we possibly disagree so sharply?</p>
  87. <p>After using Tailwind for a good while now—both professionally and on a few small personal projects—I’ve come to what might just be the most unpopular opinion of all, in regards to that question:</p>
  88. <p><strong>Both sides are right.</strong></p>
  89. <p>…Ok, ok, I can hear the boos. Nobody likes a centrist. But hear me out.</p>
  90. <p>We won’t ever get anywhere debating the merits or flaws of Tailwind, for the same reason my brother and I never persuaded each other on music.</p>
  91. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>We could’ve dissected Bon Jovi and Sufjan Stevens all we wanted. But it didn’t matter, because our disagreement ultimately started before either one of us ever pressed the play button.</p>
  92. </aside>
  93. <p class="callout svelte-rzjeng"></p>
  94. <p>We could’ve dissected Bon Jovi and Sufjan Stevens all we wanted. But it didn’t matter, because our disagreement ultimately started before either one of us ever pressed the play button.</p>
  95. <p>It turns out, he and I actually saw every artist and album in pretty much exactly the same way to begin with.</p>
  96. <p>We just never agreed on what was a feature, and what was a bug.</p>
  97. <p>Likewise, I suspect most people on opposing sides of the Tailwind debate actually complete agree on Tailwind itself. I don’t think we disagree on atomic CSS, or utility classes; I think our contention comes from the valuations we made long before we ever chose our tools. Where one of us sees a selling point, the other sees a flaw.</p>
  98. <p>Tailwind <em>is</em> great.</p>
  99. <p>Tailwind is <em>also</em> a bad idea.</p>
  100. <p>And it is both, at the same time, for exactly the same reasons.</p>
  101. <p>If you’ve played <a href="https://www.nintendo.com/store/products/mario-kart-8-deluxe-switch/" rel="nofollow">Mario Kart 8 Deluxe</a> on Switch, you might know the game offers a feature called <a href="https://mariokart.fandom.com/wiki/Smart_Steering" rel="nofollow">Smart Steering</a>.</p>
  102. <p>(<em>Yes, this is still about Tailwind. Bear with me here</em>.)</p>
  103. <p>Smart Steering is essentially an AI copilot. When enabled, you control your racer as normal, except that if you start to go off the road, the game will automatically take the wheel and steer you back on course. No more slogging through the grass, or plummeting off the side of the track.</p>
  104. <p>Smart Steering can help even the playing field among any mixed group (particularly on higher engine classes, where even very good players may find themselves hurling off the track).</p>
  105. <p>But as you get better and better at the game, Smart Steering begins to help less and less…until eventually, it starts getting in the way instead.</p>
  106. <p><img src="/images/post_images/impact.png" alt="A chart demonstrating the above paragraph; as skill level increases, the impact of usage goes from entirely positive to entirely negative."></p>
  107. <p>Smart Steering will prevent you from taking shortcuts, for one thing; it can’t tell <em>why</em> you’re going off the main road, but it jumps in the way and prevents you from doing so regardless. It may even intervene unexpectedly, pushing you off your intended course at inopportune moments.</p>
  108. <p>You might have a strategic reason in mind for going off the road (maybe you were avoiding a ruinous obstacle, for example), but Smart Steering won’t allow it regardless.</p>
  109. <p>Plus, as a balancing feature, the game’s strongest speed boosts are disabled for players utilizing Smart Steering.</p>
  110. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>The more skilled you are, the more this feature designed to augment your abilities instead begins to inhibit them. But whether it makes you better or worse—and to what degree—will depend entirely on where you’re coming from.</p>
  111. </aside>
  112. <p class="callout svelte-rzjeng"></p>
  113. <p>The more skilled you are, the more this feature designed to augment your abilities instead begins to inhibit them. But whether it makes you better or worse—and to what degree—will depend entirely on where you’re coming from.</p>
  114. <p>I’m a very good Mario Kart player (<em>I spent some thirty years of my life playing Mario Kart games before Smart Steering came along, after all</em>), and so I can’t stand Smart Steering. I never use it. I might not notice it a lot of the time—it might even occasionally help me—but what stands out to me are the times it jumps in my way at the worst possible moments.</p>
  115. <p>Smart Steering might keep me on the track, but it <em>also</em> suppresses my fullest abilities. It thwarts the best outcomes just as commonly as it averts the worst disasters.</p>
  116. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>To those sufficiently skilled with CSS, Tailwind feels like being forced to code with Smart Steering on.</p>
  117. </aside>
  118. <p class="callout svelte-rzjeng"></p>
  119. <p>To those sufficiently skilled with CSS, Tailwind feels like being forced to code with Smart Steering on.</p>
  120. <p>That’s why any conversation I have with somebody who likes Tailwind will probably be like trying to explain why I don’t like Smart Steering to a Mario Kart player who relies on it.</p>
  121. <blockquote><p>“I don’t like that it keeps me from driving off the track.”</p>
  122. <p>“What!? Why would you ever want to do that!?”</p>
  123. <p>“You can actually skip ahead if you use this trick right here…”</p>
  124. <p>“Ugh, what a hacky workaround. It’s really best practice to stay on the track, you know.”</p>
  125. <p>“Look, I understand why you’re saying that, but I’ve been doing this for a long time, and I know what I’m doing.”</p>
  126. <p>“I just don’t know why you’d make things harder on yourself, only to do something you’re not supposed to do anyway.”</p></blockquote>
  127. <div class="side-note svelte-1j8wjk4"><p>I realize I might sound rather arrogant in choosing this comparison. Mario Kart is a racing game, after all, which might seem to imply that I think of myself as a winner, and people who don’t do things my way as inferior.</p>
  128. <p>That’s not at all my intent; I only mean to point out that if Tailwind is your thing, it’s probably because we’re coming from different places, and like to play the game differently, for our own very valid reasons.</p>
  129. </div>
  130. <h2 id="there-are-no-benefits-without-tradeoffs"><a aria-hidden="true" tabindex="-1" href="#there-are-no-benefits-without-tradeoffs"><span class="icon icon-link"></span></a>There are no benefits without tradeoffs</h2>
  131. <p>For the most part, it’s perfectly fine if we see the same thing in two different, even opposite ways. However, there’s one universal truth I think it’s important we agree on as common ground, namely: <em>benefits always come with tradeoffs</em> (and vice versa).</p>
  132. <p>When it comes to frameworks, at least (CSS or otherwise), any place things seem simpler, we’re actually just experiencing the <em>upside</em> of some architectural decision. That decision, whatever it was, has downsides elsewhere; some other part of the chain, further away from our view, is now also <em>more</em> complex or difficult than it used to be.</p>
  133. <p>Don’t get me wrong; that’s still usually a good thing. The new set of tradeoffs is often preferable to the old set; we wouldn’t use frameworks if that weren’t the case.</p>
  134. <p>But complexity always exists, even if it’s remanded to a place you don’t regularly experience it.</p>
  135. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>Problems in tech don’t <em>vanish</em>; they simply get reconfigured into new shapes, with new pointy edges in new places.</p>
  136. </aside>
  137. <p class="callout svelte-rzjeng"></p>
  138. <p>Problems in tech don’t <em>vanish</em>; they simply get reconfigured into new shapes, with new pointy edges in new places.</p>
  139. <p>So we should be incredibly skeptical of any framework (any <em>product</em>, really) that claims to have eliminated complexity—destroyed it, turned it into nothing—without being honest about the byproducts.</p>
  140. <p>Ok, fine. Why is this all important?</p>
  141. <p>Because Tailwind is often marketed (and spoken of by many of its proponents) as a framework that’s achieved this impossible task of obliterating CSS’s complexity from existence.</p>
  142. <p>If you would make this argument, I would firmly dissent. But I would also agree you’re probably right <em>in your case</em>.</p>
  143. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>You likely don’t work in the areas where the tradeoffs are, so they might seem like they don’t exist to you.</p>
  144. </aside>
  145. <p class="callout svelte-rzjeng"></p>
  146. <p>You likely don’t work in the areas where the tradeoffs are, so they might seem like they don’t exist to you.</p>
  147. <p>Boring and lazily centrist as it may sound: I think we have to agree that Tailwind and vanilla CSS are both unique sets of tradeoffs. Whether we consider one better than the other will depend very much on where we spend our time, what we value, and what we ultimately consider to be <em>the point</em> of all of this.</p>
  148. <p>Let’s be fair: CSS <em>does</em> have myriad complexities and pitfalls, and Tailwind admittedly smooths out many of those rough edges, in various ways.</p>
  149. <p>But CSS is <em>also</em> an incredibly powerful programming language, which Tailwind diminishes, creating liabilities of its own along the way.</p>
  150. <p>The only <em>invalid</em> point of view is that you can have all benefits and no downsides. It just doesn’t work that way.</p>
  151. <p><em>It all depends™.</em></p>
  152. <h2 id="the-divide-where-do-you-want-to-be"><a aria-hidden="true" tabindex="-1" href="#the-divide-where-do-you-want-to-be"><span class="icon icon-link"></span></a>The divide: where do you want to be?</h2>
  153. <p>So if what we actually disagree on is what we value, that naturally begs the question: where does this divide come from?</p>
  154. <p>To me, the gap between Tailwind supporters and critics comes down to what part of the job they consider to be the most important, or perhaps, which part they just prefer to focus on.</p>
  155. <p>Because continuing to come up with synonyms for supporters and detractors is tedious, for the sake of this section, I propose we give the opposing groups names. These names will, in themselves, be coarse generalizations, which means they will have obvious outliers and glaring contradictions. But for the sake of a model that is hopefully useful despite its flaws:</p>
  156. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>Let’s call the generally pro-Tailwind group <em>Builders</em>, and let’s call the generally anti-Tailwind group <em>Crafters</em>.</p>
  157. </aside>
  158. <p class="callout svelte-rzjeng"></p>
  159. <p>Let’s call the generally pro-Tailwind group <em>Builders</em>, and let’s call the generally anti-Tailwind group <em>Crafters</em>.</p>
  160. <p>This isn’t to say that Crafters don’t build things, or that the Builders aren’t skilled craftspeople. But as a quick and messy shorthand, let’s go with it for a moment, because I think it hints at the values of these two groups.</p>
  161. <h3 id="builders"><a aria-hidden="true" tabindex="-1" href="#builders"><span class="icon icon-link"></span></a>Builders</h3>
  162. <p>Builders clearly value getting the work done as quickly and efficiently as possible. They are making something—likely something with parts beyond the frontend—and are eager to see it through to completion.</p>
  163. <p>Builders tend to tout Tailwind as the saving grace that got rid of the hard parts of CSS, after all. They like that Tailwind makes the work tidy and fast.</p>
  164. <p>That, in turn, strongly implies Builders value getting through this particular part of their work as quickly and easily as possible. (We all value efficient productivity, of course. But <em>where</em> you value it may implicitly say something about your priorities.)</p>
  165. <p>This also implies one or both of the following: either a) that they found this work overly challenging before; and/or b) that this is not the part of their job they wish to be challenged in. They likely don’t shy away from challenge; they probably just prefer it in different form.</p>
  166. <p>Again: exceptions and outliers will be plentiful, of course. But: as a group, Builders tend to be people who’ve spent their careers, if not in other parts of the stack, then at least in other areas of frontend. That is: for most Builders (though not all), CSS is not a specialty—or at any rate, not a priority. Many people who like Tailwind are also very good at CSS, but those Builders tend to be bringing a more balanced approach, where they use Tailwind for the broad strokes of utility classes, and heavily customize the config file and/or write their own CSS to fill in the gaps.</p>
  167. <h3 id="crafters"><a aria-hidden="true" tabindex="-1" href="#crafters"><span class="icon icon-link"></span></a>Crafters</h3>
  168. <p>On the other side, the Crafters tend to be seasoned CSS specialists, and almost always enjoy the part of the work that Tailwind is supposed to make easier. It’s fair to say they’ve overcome the challenge presented by CSS—or, at least, that this is where they <em>like</em> to be challenged.</p>
  169. <p>Crafters may be building holistic products and projects, just like Builders. But Crafters generally are less focused on <em>getting through</em> the frontend as a <em>part</em> of that work, and instead see the frontend as <em>the product itself</em>.</p>
  170. <p>Because of their skills with (or willingness to be challenged by) CSS, Crafters often see Tailwind as a blunt instrument that dampens their abilities. At worst, Tailwind locks off the best parts of both CSS and of their jobs. (Tailwind can’t keep up with new CSS features, and even where it can, it can’t implement everything or do everything that CSS can.) At best, it represents a hefty learning curve, just to get back to where they already are.</p>
  171. <p>Speed isn’t an issue for Crafters—or at least, not a priority; they are more concerned with the handiwork of their product. Styling is exactly where they want to be, because they value doing the work uniquely well over doing it well enough. Again, they see this work as central and defining to the product, and not just a detail of it.</p>
  172. <h3 id="builders-and-crafters"><a aria-hidden="true" tabindex="-1" href="#builders-and-crafters"><span class="icon icon-link"></span></a>Builders and Crafters</h3>
  173. <p>As <a href="https://adactio.com/journal/18982" rel="nofollow">Jeremy Keith put it so well</a>: where it comes to styling, Builders want imperative programming; they want to specify what they want, where they want, how they want it. No surprises.</p>
  174. <p>Crafters instead want declarative programming; they understand how to wield the power of creating rules of governance within a complex system, and wish to use that power, rather than <a href="https://buildexcellentwebsit.es/" rel="nofollow">micromanaging the browser</a>.</p>
  175. <p>Both Builders and Crafters have fully valid points of view. And in fairness, as I implied earlier, there exists a rich gradient of options between the two. You can balance workmanship and craftsmanship. You can use Tailwind only as much as you choose, and opt to reach for hand-authored CSS the rest of the time.</p>
  176. <p>The question is really just what you value, and where you want to spend your time.</p>
  177. <h2 id="conclusion-my-point-of-view-on-tailwind"><a aria-hidden="true" tabindex="-1" href="#conclusion-my-point-of-view-on-tailwind"><span class="icon icon-link"></span></a>Conclusion: my point of view on Tailwind</h2>
  178. <p>To continue using the distinctions above: I consider myself a Crafter. I am, therefore, wary of any tool that nudges me towards building things a certain way—<em>especially</em> when it’s proliferated across my profession, and has become so popular you can tell most websites built with it at a glance.</p>
  179. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>In my view, the more you optimize for building quickly, the more you optimize for homogeneity.</p>
  180. </aside>
  181. <p class="callout svelte-rzjeng"></p>
  182. <p>In my view, the more you optimize for building quickly, the more you optimize for homogeneity.</p>
  183. <p>I acknowledge that Tailwind might be a great solution, if its downsides are not issues for you, or if you have other means of mitigating them.</p>
  184. <p>If it solves your problems, by all means, disregard my qualms as the ramblings of an old man yelling at a Tailwind-shaped cloud. It’s only a tool, after all. It shouldn’t be something we have to agree on if we’re not working together, let alone a pillar of anyone’s identity.</p>
  185. <p>But to me, Tailwind <em>is</em> a problem in and of itself. The tradeoffs may be a net benefit for your use cases, and if so, that’s great. I’ve tested Tailwind pretty thoroughly, however, and I’ve concluded that it is <em>not</em> a net positive in my case. I don’t mind working with it on a team (it <em>is</em> useful as a unifying system, after all), but at the very least, I request the freedom to break out of it at my discretion as needed and as it’s useful. I feel <em>anyone</em> working with Tailwind should have this autonomy. I’d even go so far as to say you’re suppressing your Crafters if you <em>don’t</em> allow them that.</p>
  186. <p>I do not care how fast I build, or how easily I prototype, so much as I care that I am building something uniquely good, and building it the right way.</p>
  187. <p>Besides: I would argue that the last few years of growth in browser CSS, as well as frontend frameworks, have rendered Tailwind’s benefits largely moot for many use cases. We have <a href="https://fullystacked.net/posts/scope-in-css/" rel="nofollow"><code>@scope</code> in CSS now</a>. We have <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@layer" rel="nofollow">cascade layers</a>. Even if you don’t want to reach for those from the platform, most frontend frameworks (like <a href="https://kit.svelte.dev/" rel="nofollow">SvelteKit</a>, <a href="https://vuejs.org" rel="nofollow">Vue</a>, and <a href="https://astro.build" rel="nofollow">Astro</a>) offer scoped styling as an out-of-the-box feature. (Or you can use <a href="https://css-tricks.com/css-modules-part-1-need/" rel="nofollow">CSS modules</a>.)</p>
  188. <p>Or, if what you like about Tailwind is the utility classes, there’s the much less intrusive <a href="https://open-props.style/" rel="nofollow">Open Props</a>.</p>
  189. <p>Point is: I think Tailwind served the world of pre-2023 frontend development quite well. I don’t expect fans or organizations to move, but I <em>do</em> think we’re actively outgrowing the need for it right now. Most of the answers Tailwind provided weren’t otherwise readily available at the time, but they’re now becoming more and more just parts of the platform, and of the other tools we’re already using anyway.</p>
  190. <h3 id="some-backstory"><a aria-hidden="true" tabindex="-1" href="#some-backstory"><span class="icon icon-link"></span></a>Some backstory</h3>
  191. <p>There was a time in my career when I, along with the rest of the frontend engineers I worked with, were <em>forced</em> to write absolutely <em>everything</em> in Tailwind. There literally wasn’t a stylesheet to even put CSS into; it was forbidden. We couldn’t even edit the Tailwind config file for most of the time I was there. The powers at that company decided that was the best way to keep us all consistent. If it wasn’t Tailwind, it didn’t ship.</p>
  192. <p>(<em>Everybody I’ve told this to finds it bafflingly ridiculous. Even the most ardent Tailwind fans cite the ability to simply break out of it and write CSS any time as a necessary and beneficial feature. Nonetheless, it was our reality.</em>)</p>
  193. <p>Clearly, there was a sharp lack of representation in the room when that decision was made.</p>
  194. <p>We, the frontend team, tried reasoning with the more senior and more backend-focused developers in charge of this tooling decision; tried to explain why an all-Tailwind, no-CSS approach was not just crippling our ability to execute on our designers’ creations, but forcing us into questionable architecture choices as well. (Custom components proliferated out of control, to the point that it almost didn’t make sense to have components at all.)</p>
  195. <p>We also explained how this change was having adverse effects, both on the workers and the work. By putting our best tools just out of reach, we were forced to put more effort into crude workarounds, just to achieve mediocre results.</p>
  196. <p>We weren’t happy, and neither were the designers whose work we were implementing. (<em>Try explaining to a designer that what they want would be not only possible, but relatively trivial, if you weren’t locked into a Tailwind-only world.</em>)</p>
  197. <p>Besides, this just resulted in JIT styles being abused all over the place. The compiled stylesheet on the project had ballooned to unreasonable scale, because every team was just implementing their own one-offs willy-nilly.</p>
  198. <aside class="pull-quote svelte-omo24t" aria-hidden="true" hidden><p>Both the process and the output suffered; things were harder to build, and they turned out worse.</p>
  199. </aside>
  200. <p class="callout svelte-rzjeng"></p>
  201. <p>Both the process and the output suffered; things were harder to build, and they turned out worse.</p>
  202. <p>Unfortunately, try as we did, those explanations were summarily dismissed. It was just like the Mario Kart conversation from earlier; <em>why could you possibly want to go off the track? You’re not supposed to do that!</em></p>
  203. <p>To the powers in that company, Tailwind <em>was</em> the be-all, end-all solution. In their minds, anybody who was complaining just didn’t understand, or didn’t know what they were doing.</p>
  204. <p>They couldn’t fathom the downsides.</p>
  205. <p>In the months that followed, many of my colleagues transferred to other teams in other areas of the company. Some (like me) left entirely. That admittedly wasn’t my main reason, and I suspect it wasn’t anyone else’s either. But still: being creatively stifled by people who don’t try to understand your problems and don’t really trust that you even know what you’re talking about to begin with…well, it has a way of sticking with you.</p>
  206. <p>I think often about what I could have said in those conversations; what might have made those more senior developers in charge of our projects understand the lose-lose situation they’d put us into; made them realize that where they saw a shining sunrise of pure upside, we saw long, dark shadows of disadvantages.</p>
  207. <p>I don’t know if I could have. But since I’ve spent so much of this post talking about upsides and downsides, and how one person’s bug is another person’s feature, let’s close on that.</p>
  208. <h3 id="the-two-sides-of-the-same-coin"><a aria-hidden="true" tabindex="-1" href="#the-two-sides-of-the-same-coin"><span class="icon icon-link"></span></a>The two sides of the same coin</h3>
  209. <p>Where you might see a helpful copilot who keeps you on the track, I see a meddler who gets in the way at the worst possible moments.</p>
  210. <p>Where Tailwind ostensibly saves you from context switching, it keeps me away from the places where I do my best work.</p>
  211. <p>Where you see a tool that helps you get through a part of the job you either aren’t best at or just don’t enjoy, I see a missed opportunity for us to collaborate and put <em>both</em> our skillsets to optimal use. (I also see a cheapening of what I do; <em>your</em> code is considered important; <em>mine</em> is just something to be plowed through and done well enough to move on.)</p>
  212. <p>Where you see a solved problem, I see tech debt that simply hasn’t come due yet; where you saw how easily and quickly you could write something the <em>first</em> time, I know from painful experience how difficult it will make future refactors and rewrites.</p>
  213. <p>Where you see a tool that promises freedom, I see a lock-in mechanism that will be incredibly harrowing to undo.</p>
  214. <p>Where you see easy prototyping and fast styling, I see a tool that’s railroading us into speed-running making all the same web pages and interfaces everybody is, too.</p>
  215. <p>Where you see complexity simplified, I see a once-powerful tool, dulled and watered-down almost beyond recognition.</p>
  216. <p>Where you see empowerment, I see suppression.</p>
  217. <p>Where you see protective walls, I see a constricting cage.</p>
  218. <p>We’re both just observing the same truths from different points of view.</p>
  219. <p>We’re both wrong. We’re both right.</p>
  220. <p>It just depends how we intend to navigate the course.</p>
  221. </article>
  222. <hr>
  223. <footer>
  224. <p>
  225. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  226. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  227. </svg> Accueil</a> •
  228. <a href="/david/log/" title="Accès au flux RSS"><svg class="icon icon-rss2">
  229. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-rss2"></use>
  230. </svg> Suivre</a> •
  231. <a href="http://larlet.com" title="Go to my English profile" data-instant><svg class="icon icon-user-tie">
  232. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-user-tie"></use>
  233. </svg> Pro</a> •
  234. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel"><svg class="icon icon-mail">
  235. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-mail"></use>
  236. </svg> Email</a> •
  237. <abbr class="nowrap" title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340"><svg class="icon icon-hammer2">
  238. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-hammer2"></use>
  239. </svg> Légal</abbr>
  240. </p>
  241. <template id="theme-selector">
  242. <form>
  243. <fieldset>
  244. <legend><svg class="icon icon-brightness-contrast">
  245. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-brightness-contrast"></use>
  246. </svg> Thème</legend>
  247. <label>
  248. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  249. </label>
  250. <label>
  251. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  252. </label>
  253. <label>
  254. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  255. </label>
  256. </fieldset>
  257. </form>
  258. </template>
  259. </footer>
  260. <script src="/static/david/js/instantpage-5.1.0.min.js" type="module"></script>
  261. <script>
  262. function loadThemeForm(templateName) {
  263. const themeSelectorTemplate = document.querySelector(templateName)
  264. const form = themeSelectorTemplate.content.firstElementChild
  265. themeSelectorTemplate.replaceWith(form)
  266. form.addEventListener('change', (e) => {
  267. const chosenColorScheme = e.target.value
  268. localStorage.setItem('theme', chosenColorScheme)
  269. toggleTheme(chosenColorScheme)
  270. })
  271. const selectedTheme = localStorage.getItem('theme')
  272. if (selectedTheme && selectedTheme !== 'undefined') {
  273. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  274. }
  275. }
  276. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  277. window.addEventListener('load', () => {
  278. let hasDarkRules = false
  279. for (const styleSheet of Array.from(document.styleSheets)) {
  280. let mediaRules = []
  281. for (const cssRule of styleSheet.cssRules) {
  282. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  283. continue
  284. }
  285. // WARNING: Safari does not have/supports `conditionText`.
  286. if (cssRule.conditionText) {
  287. if (cssRule.conditionText !== prefersColorSchemeDark) {
  288. continue
  289. }
  290. } else {
  291. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  292. continue
  293. }
  294. }
  295. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  296. }
  297. // WARNING: do not try to insert a Rule to a styleSheet you are
  298. // currently iterating on, otherwise the browser will be stuck
  299. // in a infinite loop…
  300. for (const mediaRule of mediaRules) {
  301. styleSheet.insertRule(mediaRule.cssText)
  302. hasDarkRules = true
  303. }
  304. }
  305. if (hasDarkRules) {
  306. loadThemeForm('#theme-selector')
  307. }
  308. })
  309. </script>
  310. </body>
  311. </html>