<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Dasher</title>
    <description>The latest articles on Forem by Dasher (@dasher).</description>
    <link>https://forem.com/dasher</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F3808%2F910e80ba-1b43-4a34-a12e-739e9c0bb744.png</url>
      <title>Forem: Dasher</title>
      <link>https://forem.com/dasher</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dasher"/>
    <language>en</language>
    <item>
      <title>Nuxt Tailwind Breakpoint Helper</title>
      <dc:creator>Dima</dc:creator>
      <pubDate>Mon, 15 Mar 2021 14:42:25 +0000</pubDate>
      <link>https://forem.com/dasher/nuxt-tailwind-breakpoint-helper-2a62</link>
      <guid>https://forem.com/dasher/nuxt-tailwind-breakpoint-helper-2a62</guid>
      <description>&lt;p&gt;In &lt;em&gt;Dasher&lt;/em&gt; we do a lot of web front-end. We use &lt;strong&gt;Vue, Nuxt and Tailwind CSS&lt;/strong&gt; for it. We really love fast prototyping and quality outputs. We wanted to make our development experience even more enjoyable and effective ⚡.&lt;/p&gt;

&lt;p&gt;Further, I will write why we created our small and really simple module &lt;a href="https://www.npmjs.com/package/@dashers/nuxt-tailwind-breakpoint-helper" rel="noopener noreferrer"&gt;&lt;strong&gt;Nuxt Tailwind breakpoint helper&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Once upon a time
&lt;/h1&gt;

&lt;p&gt;Our front-end developer, while testing responsive Vue component in a browser, said that he would like to see current screen size, which is defined in Tailwind config file.&lt;/p&gt;

&lt;p&gt;As you know, when you change screen size in an inspect mode in a browser you see real viewport size in pixels. But when you write responsive styles in Tailwind it looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"max-w-full sm:max-w-md md:max-w-2xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;paragraph...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you see &lt;code&gt;sm&lt;/code&gt; (min-width: 640px) and &lt;code&gt;md&lt;/code&gt; (min-width: 768px) screen sizes, which are defaults in &lt;a href="https://tailwindcss.com/docs/breakpoints" rel="noopener noreferrer"&gt;Tailwind config&lt;/a&gt;. But you can re-write them or extend to have your own values such as &lt;code&gt;super-extra-big-screen-size&lt;/code&gt; and it could have value &lt;code&gt;min-width: 4000px&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;Lot of us have some issues with a memory (now I mean human memory 🧠). There are times when we can't quite remember if &lt;code&gt;md&lt;/code&gt; screen size starts from 768px or some other value, &lt;strong&gt;but we want to see which Tailwind screen size is applied right now.&lt;/strong&gt; Also, we don't want to open inspect mode everytime.&lt;/p&gt;

&lt;h1&gt;
  
  
  How we helped ourselves
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgitlab.com%2Fdashers%2Fpublic%2Fbreakpoint-helper%2F-%2Fraw%2Fmaster%2Fpublic%2Fimages%2Fexample2.gif%3Fv1" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgitlab.com%2Fdashers%2Fpublic%2Fbreakpoint-helper%2F-%2Fraw%2Fmaster%2Fpublic%2Fimages%2Fexample2.gif%3Fv1" alt="NTBH gif example" width="760" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We created our own NuxtJS module, which embeds a small "widget" to the left bottom corner of a browser's viewport and shows current Tailwind screen size (sm, md,...) and actual viewport height and width in pixels. Module is injected only in development mode. You can also style it as you need using module options in &lt;code&gt;nuxt.config.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, we can debug and tune up our components even faster and have an actual Tailwind screen size everytime!&lt;/p&gt;

&lt;h1&gt;
  
  
  In the end
&lt;/h1&gt;

&lt;p&gt;We would appreciate any comments, feedback or contribution to the module if you want to use it, but missing something ✌.&lt;/p&gt;

&lt;p&gt;Thanks for reading! The Dasher Team ⚡&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔗 &lt;a href="https://www.npmjs.com/package/@dashers/nuxt-tailwind-breakpoint-helper" rel="noopener noreferrer"&gt;NPM package of the module&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔗 &lt;a href="https://gitlab.com/dashers/public/breakpoint-helper" rel="noopener noreferrer"&gt;Gitlab Repo of the module&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔗 &lt;a href="https://www.dasher.cz/" rel="noopener noreferrer"&gt;Dasher website&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nuxt</category>
      <category>tailwindcss</category>
      <category>package</category>
      <category>dx</category>
    </item>
  </channel>
</rss>
