avatarJennifer McDougall

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2713

Abstract

Files</h1><p id="aea6">We need to add a <code>tailwind.config.js</code> and a <code>postcss.config.js</code> file to the root of our application. Use the following command to set this up:</p><div id="ee16"><pre>npx tailwindcss <span class="hljs-keyword">init</span> -p</pre></div><p id="414e">This will create a <code>tailwind.config.js</code> file at the root of your project:</p> <figure id="59e0"> <div> <div>

            <iframe class="gist-iframe" src="/gist/BetterProgramming/5f1fc501fe510339576a69bd5936c2b1.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="21b1">Learn more about configuring Tailwind in the <a href="https://tailwindcss.com/docs/configuration">configuration documentation</a>.</p><p id="374c">It will also create a <code>postcss.config.js</code> file that includes <code>tailwindcss</code> and <code>autoprefixer</code> configured:</p>
    <figure id="5464">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/BetterProgramming/373cad919a6f591df7649efec7dcce78.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><h1 id="d634">Import the CSS</h1><p id="07d3">Let’s create a <code>styles</code> folder and import Tailwind CSS from a CSS file:</p><div id="236d"><pre><span class="hljs-built_in">touch</span> styles/tailwind.css</pre></div><p id="79bb">Inside <code>tailwind.css</code>:</p><div id="33c2"><pre><span class="hljs-variable">@tailwind</span> base;

<span class="hljs-variable">@tailwind</span> components; <span class="hljs-variable">@tailwind</span> utilities;</pre></div><p id="5160">To add global CSS to a Next.js app, we need to override the default <code>App</code> component. With Next.js 10, you should already have <code>_app.js</code> inside your pages folder. Now import the stylesheet we created:</p><div id="da6f"><pre><span class="hljs-function"><span class="hljs-title">import</span></span> <span class="hljs-string">'../styles/globals.css'</span> <span class="hljs-function"><span class="hljs-title">import</span></span> <span class="hljs-string">'../styles/tailwind.css'</span>;</pre></div><div id="c873"><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">MyApp</span>(<span class="hljs-params">{ Component, pageProps }</span>) { <span class="hljs-keyword">return</span> <span class="language-xm

Options

l"><span class="hljs-tag"><<span class="hljs-name">Component</span> {<span class="hljs-attr">...pageProps</span>} /></span></span>; }</pre></div><p id="cd5c">Cool, now we are ready to add some Tailwind CSS magic to our home page. Go to <code>/pages/index.js</code> (or <code>/pages/index.tsx</code> if you use TypeScript) and add some elements with Tailwind CSS classes. For example:</p> <figure id="7022"> <div> <div>

            <iframe class="gist-iframe" src="/gist/BetterProgramming/5d768ccc213a3d4eeff44d3955cebd3d.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="12b1">Run <code>yarn dev</code> to see your app on <a href="https://localhost:4202/settings/departments">http://localhost:3000</a> in your browser.</p><h1 id="996b">Configure PurgeCSS</h1><p id="d1b6">One problem with Tailwind CSS is the large file size, but <a href="https://github.com/FullHuman/purgecss">PurgeCSS</a> can fix this. PurgeCSS reduces the file size by scanning your HTML and removing any classes that aren’t used. We only want this in production because if we are developing, we want to be able to use any Tailwind CSS class without running the build process.</p><p id="a37c">Now with Tailwind CSS v2, PurgeCSS is already included. All you have to do is update the <code>tailwind.config.js</code> file so Tailwind can tree-shake unused styles in production builds. Update your file like this:</p>
    <figure id="c01b">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/BetterProgramming/4fe51a3e9e7f33b4e647ffee294f8cdb.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="2dad">For now, we check all of our code inside <code>.js, .jsx, .ts or .tsx</code> files that live in either the <code>pages/</code> or <code>components/</code> folder. If you plan to add HTML in other folders like <code>containers/</code> or something, make sure you add that folder to this configuration file.</p><p id="29a2">You can read the guide from Tailwind on <a href="https://tailwindcss.com/docs/optimizing-for-production">optimizing for production</a> to learn more about tree-shaking unused styles for best performance.</p><h1 id="6371">Conclusion</h1><p id="fafc">Now we are ready to work with the latest versions of Next.js and Tailwind CSS without having to worry about bundle sizes!</p><p id="fdfe">That’s it! Thanks for reading. I hope it was helpful.</p></article></body>

WHAT TO DO SERIES

What To Do When You Get Stood Up

Boneheads happen

Photo by Chetan Hireholi on Unsplash

“Whatever. I’ll just date myself.” Unknown

Have you ever been the victim of a no-show first date?

Sitting in the parking lot, I waffled between scanning incoming vehicles and attempting to read my book. According to my GPS, I was at the right address. I had sent a message warning that I would be late. Pre-Christmas nutbars were overcautiously driving 20km an hour on the slightly icy highways and I pulled in two minutes after the hour we had agreed upon.

The dude, who had sweated through a night shift ending only a couple of hours before our meeting, was due to arrive at any moment. I’d informed him about my gray van and lapis-hued jacket. Why hadn’t I thought to ask what type or color of vehicle he drove?

I had referee-ed my family, carved out a block of time in my schedule, and had driven an hour to meet. As I waited and watched the only automobiles passing by were ones zipping towards the nearby crowded hardware store. Even blasting 80s beats didn’t comatose my nerves.

After 21 minutes I texted a friend asking her whether I should continue crumbling the ozone by idling my van to stay warm. Or if I should wave the white flag and head out on my mission to find new running shoes.

Leave,” she messaged back. “If he can’t text and he is late, not worth it.

What to have

Preparations for such a disheartening situation are fairly simple. You really only require a juicy book or music and a Plan B.

On a side note, your book can be used as a super effective rate your date tool. Do their eyebrows lift higher than a kite when they see Sonya Renee Taylor’s mostly naked body adorning the cover? Do they squirm when spying Unf*ck Yourself tucked beside your coffee? Does the Bible cause them to cough out a Covid-like bark and hightail it in the opposite direction? Your reading material may prove to be a better judge of character than you are.

What to Do

Because I live in the arse-end of nowhere, my trips to towns where people drive cars rather than horses and buggies always involve a To-Do list. Get an oil change, spend my paycheque at Starbucks, empty Costco’s Cheerios section, fill up on sushi.

This handy agenda also means I have a Plan B for when Prince Charming is mysteriously stranded between the rinse and the wax cycle at the automatic car wash or has his penis attached to the lips of the woman he’d scheduled to meet the hour before me.

Before you get all Katniss Everdeen, though, be sure to give them the benefit of a doubt. Communicate. Don’t be afraid to ask why or to suggest they apologize. Maybe their feline friend really did have explosive diarrhea. Perhaps their great uncle’s funeral was re-scheduled for that morning and their excessive grief led to memory loss.

Or maybe they’re just a bonehead.

Remember that a prospect gone AWOL is in no way a reflection of you or your worthiness. Dating coach Alessandra Conti encourages us to

“just accept that sometimes it happens, but it’s hardly the end of the world”.

You can decide whether you’ll watch them grovel and accept their sincerest of sorry or if a no-show is a no-go.

Takeaways

Back-up plans are your best friend when it comes to dating. My absentee scoundrel may have tumbled into sleep on his couch but I still landed a sweet deal on cross-trainers, finished my Christmas shopping, and met my BFF for a late lunch.

And that probably turned out for the best. He may have stood me up but I didn’t. And I’m the greatest sidekick I’ve ever dated.

©Jennifer J. McDougall 2022

Humor
Humour
Advice and Opinion
Dating
This Happened To Me
Recommended from ReadMedium