avatarMatthew Maniaci

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>

I Don’t Know How Else to Explain that You Should Care About Other People

The difficulties of explaining empathy to those who have none

Photo by Clay Banks on Unsplash

For me, it started nearly a decade ago. I was talking with a few coworkers in the back room of the grocery store where I worked. Obamacare was the topic.

My boss, a cranky older white guy, commented that he “didn’t want to pay for health insurance for someone who hasn’t earned it.”

That didn’t sit well with me, but I couldn’t tell you why at the time. It seemed strange to me that someone could be so callous about other people’s health, but I didn’t have the language to properly express that.

Over the past few years, I’ve gone from an Obama liberal who was pro-Obamacare to a Bernie liberal who is pro-single payer healthcare. My general stance has gone from a conciliatory “we need to work together to accomplish things” to a more standoffish “the Republican party has turned into a bunch of soulless monsters headed by a raging narcissist, and they’re dead-set on killing America.”

Along the way, I’ve consumed a lot of media, think-pieces, and memes that express a lot of views that I have grown to agree with. One of those things is the title phrase: I don’t know how else to explain that you should care about other people.

America is the land of opportunity, and the American dream is alive and well, or so they say. “Life, liberty, and the pursuit of happiness,” just like it says in the Declaration of Independence.

The reality on the ground is a lot harsher. Medical debt contributes to a ridiculous number of bankruptcies. Homeownership rates of young people are lower than in the past, as young people are hampered by student loan debt and a job market that either won’t hire them or puts them in jobs outside their expertise. By and large, Millennials have been declared the new lost generation.

This picture helps us understand why we want the things we want. Single-payer healthcare and free college are good starting points, as they will help future generations avoid the pitfalls that have befallen us. Student loan debt forgiveness would go a long way to helping millions of people.

This is where a lot of people get hung up. “If we forgive student loan debt, it’s unfair to the people who paid off their student loans!” they cry.

Bullshit.

As someone who has paid off his student loans, I want student loan forgiveness because I have some basic level of empathy for other people. I was able to pay off my loans because I was equal parts diligent and lucky. That doesn’t change the fact that millions of other people aren’t in a position to pay off their loans because of the aforementioned job market.

To put it another way, people opposed to student loan forgiveness take the approach of “I did it, so you should too.” I take the approach of “I did it and will work to make sure you don’t have to.” Student loans are a burden that many carry, and just because I carried it doesn’t mean you should have to. It’s not some sort of hazing ritual.

College needs to be free, or at least much cheaper than it is. I feel like pursuing an education to better yourself and your family falls under that whole “pursuit of happiness” thing that is part-and-parcel of our American Dream.

The same thing goes for healthcare. Not wanting to pay for healthcare for someone who didn’t “earn” it ignores the fact that healthcare should be a basic human right. It’s the “life” thing that I mentioned above from our founding document.

The simple fact is that we shouldn’t have to earn healthcare. We as Americans pay more than any other industrialized country for sub-par healthcare because of bloated health insurance and hospital systems. Americans are generally shocked to find out that people in other countries pay less for healthcare not because it’s lower quality, but because healthcare actually costs much less than we pay for it.

Having a child or breaking a leg should not put you thousands of dollars into debt. Having the audacity to get cancer shouldn’t bankrupt your family. Getting hit by a car shouldn’t be financially ruinous. People shouldn’t have to wear armbands asking people not to call an ambulance unless their seizure lasts for more than a few minutes because ambulances are expensive. Insulin shouldn’t cost thousands of dollars per year.

I could go on. I’d rather not.

What I’m saying is that I shouldn’t have to live in a country where getting cancer means I have to seriously consider putting a bullet in my brain to avoid bankrupting my wife. I’m also saying that the fact that I have to explain this to people who will continue to disagree with me is disgraceful. You need to care about other people. It’s how we as the human race have come to dominate the planet — by working together for a greater good. Concentrating resources in the hands of a few while foregoing the many is the path to destruction.

This is made even worse by the ongoing protests for the Black Lives Matter movement. Unarmed black men are getting killed by violent, racist policing, and people are jumping to defend the violent, racist cops. There are all sorts of excuses — [insert unarmed black victim] was already a criminal is a common one. White people get killed by cops too is another.

Both of these arguments ignore the fact that the police should not be extrajudicially executing people, regardless of whether they’re criminals or not. That’s the “liberty” part I mentioned above — we have the right to a fair and speedy trial, and we also have the right not to get gunned down in the streets by trigger-happy, poorly-trained police. Considering our police kill many times more people than European police, we have to start to wonder why.

People are also quick to defend riot police attacking peaceful protestors with rubber bullets and pepper spray. “Rioters need to be dealt with harshly,” they say. “Those protests get out of control,” they say. Considering that the militarized police forces across the country have been documented agitating and using preemptive force against protestors, it feels a bit hollow, especially when the protestors are doing the police’s job of defusing tensions.

I don’t know how else to explain to people that police brutality is not something to be celebrated. Wearing a Blue Lives Matter Punisher skull encourages the police to be violent thugs in the image of the Marvel anti-hero, who is a violent vigilante that kills people in cold blood without any kind of trial. Making the police force into an army of Punishers sort of defeats the purpose of “protect and serve.” Even the Punisher knows this.

To add another layer of stupidity on top of everything, we have a pandemic raging, and a whole bunch of people who feel it’s a violation of their rights to force them to wear masks in public. You can explain that the masks are primarily for people who may already be infected and that the virus is commonly present in people without symptoms and is transmittable for days before symptoms form. You can talk about how we may not even be out of the first wave yet, and that relaxing precautions now could be catastrophic. It doesn’t matter to them.

To them, fixing the ruined economy is more important than the old and immunocompromised. The risk of killing someone close to them doesn’t occur, as COVID deaths only happen to other people. In general, their need to get out of the house and not be constrained by “unconstitutional” mask rules outweighs the greater public good.

“We need to reopen the economy and get people back to work,” they say, ignoring the resulting spikes in cases and deaths. “We can’t leave people out of work forever,” they say, ignoring the fact that much of Europe is managing to keep unemployment down with short-time work programs and wage subsidies. “We can’t pay people to stay home and do nothing,” they say, again ignoring the fact that Europe is doing basically that fairly successfully.

None of their calculations involve reducing risk to the general public. They only want them and their families to be able to go to a bar or restaurant, confident that they will not catch the disease and ignorant that they may be the ones spreading it. Any human losses are acceptable, they say, as the people dying are old and weak and not contributing in any meaningful way, ignoring the fact that their parents and grandparents (or them, in many cases) are in high-risk groups and they may become responsible for killing some older family members as a result.

To the people I describe above, there simply isn’t a calculation for the human cost. Whether the tens of thousands lost to bankruptcy or student loan payments, the unnecessary deaths of the uninsured, the extrajudicial killings of unarmed black men (or anyone, really) by police, or the rapidly increasing death toll from COVID, none of it matters to them.

This is America, after all, and if you can’t make it by your own powers, then you deserve to die. The weak are weeded out, and only the strong survive. Or, put bluntly, “I got mine so screw you.”

Taking all of that into consideration, I don’t know how else to explain to these people that they should care about someone other than themselves. Statistics and facts don’t impact them — they’re all about ‘fake news” and “alternative facts.” Anything that doesn’t fit their narrative is obviously wrong.

Appealing to a common sense of decency doesn’t seem to work either. These people are often selfish and self-centered; phrasing arguments in terms of some stranger they don’t know has no impact on someone who cares only for themselves. So too are they afraid of people different than them; if a thing could help someone outside their group, particularly a minority group, it’s an immediate no-go.

They are often fearful of what helping the common good can do. For the well-to-do, helping the common good is a threat to their position of power. For the less well-off, elevating those with less than them threatens the very little they do have.

Race and gender politics abound with them. They fear that if women and minorities gain more rights, they’ll oppress white men as the white men have oppressed the women and minorities. Attempting to argue that women and minorities don’t want to oppress, they just want a fair share, doesn’t fit their narrative of power. Obviously, they’re just lying to gain power over the poor white guys. The thought that someone might not want to exploit a position of power is foreign.

So what should we do about these people, who refuse to care about anyone other than themselves and their small groups?

At this point, the conclusion I’ve reached is “save your breath.” We live in a political climate where a third of the country is led by a narcissistic pathological liar and will believe anything he says, regardless of how truthful (or untruthful) it is. Any argument against it is fake news.

There’s no getting through to these people. If Joe Biden took office tomorrow and declassified every document that the Trump administration put together that indisputably proves massive, wanton corruption, Trump’s followers would call it a deep state hit job. It’s like a cult.

Unfortunately, the best path forward may be patience. The country’s demographics are working against them, which they are acutely aware of and afraid of. Young people are disproportionately liberal, and white people will soon comprise less than 50% of Americans. The bell will be tolling for them soon.

It may not be soon enough. The country is in chaos, and the man at the helm is actively destroying as much as he can before his people lose power. We are at a critical juncture in our country’s history, where the re-election of Donald Trump may signal the end of our country as we know it.

So, rather than try to argue with people who don’t care and will never care about other people, we need to use the best tool we have: activism. I’ve written about what we can do to help further the cause, and not all of it is going out into the streets to protest. One of the better tools we all have is the vote. Trump and his groupies are actively working to squash liberal voters. There’s more of us than there are of them, and Trump knows it.

Another tool we can use that may be more effective than our individual votes is to encourage other people to vote. Voter turnout was low in the 2016 election, and the article linked above has a Trump quote about how easy voting means that Republicans would never get elected again. They know that more people are against them than for them, and the thing they’re afraid of most is a high voter turnout.

So, push your friends to vote. Get them to vote for Biden. I don’t like Biden personally, but I’m still voting for him because to vote for anyone else is to execute America by firing squad. Remember, there’s more of us than there are of them. We have the power of numbers.

And keep doing the other things that I’ve talked about. Go out and protest. Donate to bail funds or the NAACP. Write blog posts. Do whatever you can to contribute to the cause.

Most importantly, keep up hope. There’s a whole block of the country that doesn’t care about anyone other than themselves, but they’re a minority. They want to rule by fear and terror, squashing those who oppose them under their bootheels. They underestimate empathy and compassion because they have none.

Show them what empathy and compassion can do.

Black Lives Mater
Covid-19
Healthcare
Politics
Society
Recommended from ReadMedium