<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="268381" data-post-id="268381">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cjbottaro" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cjbottaro/120/1469_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cjbottaro
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tadasajon" data-post="1" data-topic="43331">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tadasajon/48/23216_2.png" class="avatar"> tadasajon:</div>
<blockquote>
<p>I can barely tell the value of Tailwind over just using inline styles.</p>
</blockquote>
</aside>
<p>Haha, if that ain’t a mood then I dunno what is… <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" loading="lazy" width="20" height="20"></p>
<p>I can’t see something like Tailwind working outside a world where “view components” are the norm.</p>
<p>But then… why not just use inline styles on your components?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="268381" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/why-am-i-only-now-learning-about-milligram-it-is-included-by-default-why-the-tailwind-hype/43331/55">Post #54</a>
	                </div>
	            </div>
              <div id="likers-container-268381" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="268381"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #54"></div>
  </section>
</div>
    <div class="postbit" id="268411" data-post-id="268411">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cjbottaro" data-post="55" data-topic="43331">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cjbottaro/48/1469_2.png" class="avatar"> cjbottaro:</div>
<blockquote>
<p>But then… why not just use inline styles on your components?</p>
</blockquote>
</aside>
<p>Try getting responsive behaviour out of inline styles or focus/hover/… styles. Tailwind often maps to a single style, but there are also quite a few abstractions on top, where a single utility class sets multiple css properties. It‘s for sure a shallow level of abstraction, but I found this very useful and preferable to heavier, but usually less flexible/composable, abstraction attempts.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="268411" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/why-am-i-only-now-learning-about-milligram-it-is-included-by-default-why-the-tailwind-hype/43331/56">Post #55</a>
	                </div>
	            </div>
              <div id="likers-container-268411" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="268411"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #55"></div>
  </section>
</div>
    <div class="postbit" id="268422" data-post-id="268422">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dmitriid" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dmitriid/120/13182_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dmitriid
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>why not just use inline styles on your components?</p>
</blockquote>
<p>Tailwind provides:</p>
<ul>
<li>
<p>a working set of consistent design tokens out of the box: anything from standardised sizes to margins to color progressions<br>
<br>
I’ve tried to figure out how to do a design system for ages, but I’m not a designer. Many existing design systems and frameworks usually box you into an inflexible set of constraints. Tailwind is flexible, but still gives you consistency (especially coupled with their UI examples)</p>
</li>
<li>
<p>convenient shortcuts to properties and combinations of properties that you might not remember off the top of your head<br>
<br>
As someone mentioned above, a simple <code>shadow-md</code> is actually <code>0 0 #0000, 0 0 #0000, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);</code>, and “ain’t no one got time for that” <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"><br>
<br>
You can replace these with CSS variables, but then you have properties like <code>text-sm</code> which is <code>font-size: 0.875rem; line-height: 1.25rem;</code>, so you have to remember to always use them together. I know, I once tried to use CSS variables only, and was lifting their definitions directly from Tailwind. Then I gave up and just went with Tailwind. <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"><br>
<br>
(Side note: this was a big missed opportunity for CSS vars: to be able to include several properties in one variable)</p>
</li>
<li>
<p>utility classes are descriptive. Compare <code>shadow-md</code> to the jumble of characters it resolves to</p>
</li>
<li>
<p>less work for the browser to do: it needs to parse classes and apply them, not create a separate combination of styles for each document</p>
</li>
<li>
<p>there’s also a nice thread by Dan Abramov on Tailwind that touches a bit on inline styles, too: <a href="https://twitter.com/dan_abramov/status/1452324924421550080" rel="noopener nofollow ugc">https://twitter.com/dan_abramov/status/1452324924421550080</a></p>
</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="268422" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/why-am-i-only-now-learning-about-milligram-it-is-included-by-default-why-the-tailwind-hype/43331/57">Post #56</a>
	                </div>
	            </div>
              <div id="likers-container-268422" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="268422"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #56"></div>
  </section>
</div>
    <div class="postbit" id="268426" data-post-id="268426">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dmitriid" data-post="57" data-topic="43331">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dmitriid/48/13182_2.png" class="avatar"> dmitriid:</div>
<blockquote>
<p>less work for the browser to do: it needs to parse classes and apply them, not create a separate combination of styles for each document</p>
</blockquote>
</aside>
<p>It’s been way to long (like 8-10 years ago) to link to sources, but I seem to remember someone benchmarking a single class per css property and that actually turned out to be really performant with browsers (at least the time) – iirc because it matched well to how browsers map styles to elements. Being done for just the benchmark it lacked the necessary tooling and the “terseness” of tailwind class names (it used written out css property names turned to classes) to be useful, but it’s still interesting to see how such “early” experiments map to something becoming popular years later.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="268426" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/why-am-i-only-now-learning-about-milligram-it-is-included-by-default-why-the-tailwind-hype/43331/58">Post #57</a>
	                </div>
	            </div>
              <div id="likers-container-268426" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="268426"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>