avatarJosh Kiev

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

2236

Abstract

was an issue remaining. The document used dark theme and the content in the external page used white background.</p><p id="0afe"><b>Hack 2: </b>Use dark-reader to automatically generate css for your external page</p><p id="f222">You can use <a href="https://darkreader.org/">dark-reader</a> to automatically apply dark style to your page. There are two options. First is to use dark-reader in your project via npm and apply dark theme automatically. For my case, this was a bit overkill and I choose the second option. Second option is to generate and export css file corresponding to dark theme of your external page and then adding that style-sheet to our <code>iframe</code>.</p><p id="df41">First install the <a href="https://darkreader.org/">dark-reader</a> add-on/extension to your browser. I have done it on Firefox. Then open your external page in that browser and enable the dark-mode in dark-reader add-on.</p><figure id="54a0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*akq4Mmrutw6XTVdZMY9VBQ.png"><figcaption>dark-reader add-on in Mozilla Firefox</figcaption></figure><p id="ded5">When you enable dark-mode, the dark-reader has generated and applied appropriate styling to make your page dark-themed. It works great. You can also tweak around and set brightness, and contrast as well as use developer tools to further customize the design. Once you are happy with the design, click on the dark-reader browser-action button to open the popup menu and click on settings.</p><figure id="af34"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*B_-rTeDGalYJ-Ci6nyyapg.png"><figcaption></figcaption></figure><p id="0ea2">This will open up the settings view as displayed below.</p><figure id="bac9"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*dqdeQaWkTj38obrpRLEoVg.png"><figcaption></figcaption></figure><p id="1b63">Click on Manage settings and then on <b>Export Dynamic Theme</b>.</p><figure id="504a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*eoK7sNZcYxZF-xWQ3NjEIg.png"><figcaption></figcaption></figure><p id="2bb4">Great job! This will download a css file that you can add to your page to apply the styles for dark theme. Hmmm… So far so g

Options

ood. I believe most of you would do the rest of the stuff on your own, but for the sake of completeness let us add a few lines of code to the event-listeners that we created in Hack1.</p><p id="2a64">Save the css file that was downloaded by the dark-reader as <code>dark-theme.css </code>in the <code>/public</code> directory of your Next.js app. Now, add following lines inside the <code>"load"</code> event-listener.</p><div id="d14f"><pre>const link <span class="hljs-operator">=</span> doc.createElement(<span class="hljs-string">"link"</span>)<span class="hljs-comment">;</span></pre></div><div id="e451"><pre><span class="hljs-attr">link.rel</span> = <span class="hljs-string">"stylesheet"</span><span class="hljs-comment">;</span></pre></div><div id="d811"><pre><span class="hljs-attr">link.href</span> = <span class="hljs-string">"/dark-theme.css"</span><span class="hljs-comment">;</span></pre></div><div id="214b"><pre>doc.head.appendChild(link)<span class="hljs-comment">;</span></pre></div><p id="caa5">Next time when you do this, you will be able to add existing HTML files to your project with custom themes in much lesser time than the time you spent reading this document.</p><p id="3a9a">Wish you all the best and happy coding!</p><p id="ad6f">Interested in building career in web development? Checkout E-degree in JS Frameworks</p><div id="2976" class="link-block"> <a href="https://www.eduonix.com/javascript-frameworks-mini-edegree/UHJvZHVjdC00NDExNjgw"> <div> <div> <h2>JavaScript Mini E-Degree: Master JS Frameworks To The Core!</h2> <div><h3>A perfect mini-e-degree suitable for everyone who wants to master JavaScript effectively without wasting any time…</h3></div> <div><p>www.eduonix.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*OBLf0FHe3Jrk8Lbg)"></div> </div> </div> </a> </div><p id="79c1">Or my course on <a href="https://www.udemy.com/course/react-and-next-js-with-typescript/?referralCode=7202184A1E57C3DCA8B2">React + Next.js with TypeScript</a>.</p></article></body>

What Is Your Internal Critic’s Name?

A Tiny Moment of “Facing Your Worst Foe”

Photo by Paul Garaizar on Unsplash

The Moment

They loom in the distance but appear suddenly and swiftly when they smell blood. If you think you are doing poorly, they suggest you are doing worse. If you want to reach out and grab the stars, they tell you that you will get burnt.

They think you won’t ever be anything. What you dream will never come true. Why would you dare even try? Everything that has gone wrong is your fault and you deserve it. Use your addictions. Blame others. Give up. Stop trying. Fall into the failure. No one cares about you.

This is how an Internal Critic operates. My Internal Critic’s name is Ike Charles. IC for short.

The Reflection

The Internal Critic will pound you into the ground until there’s nothing left. The frightening part is that the relationship is parasitic. No host, no critic. However, you remain on emotional life support, because every virus needs a host and this son of a bitch likes to keep you barely breathing.

Everyone has this war to wage. Even the most outgoing people have a little tiny spirit that torments and picks at their every move. IC and I have been through many wars. Some days were darker than most. I began to get the upper hand when I realized his existence. I was aware of what I was facing.

It didn’t make things easier but knowledge helps you fortify your emotional journey. You will still have to learn to recognize what is reckless and what is righteous in your life. The Internal Critic merely wants you to end up on the floor face down.

Most things that I have accomplished in my life that were positive, I just did them and told Ike to take a flying leap. I weighed pros and cons, but in the end, I needed to take risks and have faith that what I was doing was right for me. You will too!

Everything that has failed or worked out has been my doing. IC takes credit for nothing, offers no advice, other than to tell me I’m garbage.

Hey Ike! %&?! you!

He goes to sleep when stuff is good. He wants no part in positive feelings unless he’s throwing clouds on those feelings. He wins only when I refuse to move or stop trying. Keep moving.

I cannot say these words by Marianne Williamson enough.

We ask ourselves, who am I to be brilliant, gorgeous, talented and fabulous?

Actually, who are you not to be?

The Takeaway

  • Know how to put your critic to sleep when they wake up. They devour and thrive on inertia.
  • Don’t confuse fatigue with doing nothing. Rested souls flourish.
  • Fatigued thinking is not always correct.
  • Find a way to coexist with your Internal Critic. They are always sneaking around in the shadows.
  • You are great. You are powerful.
  • The Internal Critic is your biggest bully coming for you. Stand up to them and watch them shrink.

Josh Kiev is an actor, chef, and has got something for his Internal Critic when he comes looking for trouble.

If you liked the above, I have lots more to share and I kindly request you to specifically do the following:

1. Follow me on Twitter & Medium. 2. Give a Like or a Clap. 3. If possible, please leave a comment. I would love to have feedback. 4. If possible, please share my article on your Twitter, Medium, or Facebook feed.

For it is only by connecting with the world at large, learning from the world, and sharing with the world that you and I will be able to make a genuine difference to the world. This is my life’s purpose. Take care for now. I look forward to hearing from you. Thank you for your time. Connect or Perish.

Tiny Life Moments
Critics
Positive Thinking
Life Lessons
Self Love
Recommended from ReadMedium