avatarDrthefit | Ankita

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>

How to Disconnect From Work Without Feeling Guilty

Less burn out and more fun.

Photo by Dai KE on Unsplash

Tell me if this sounds familiar.

  • You work 8–10 hour days hunched over your laptop, hardly stopping for water or food.
  • You go back to work after dinner to knock off “just a few more things” from your to-do list but then go to bed feeling restless.
  • You then dream about work and sometimes wake up with nightmares about the day ahead or things you forgot to do.
  • You spend your weekend trying to “catch up” on work instead of devoting time to family, self-care, or hobbies
  • You feel guilty when you do indulge in well-deserved rest.
  • You tell yourself you should be doing something more productive with your downtime.
  • You don’t feel restored even after taking a few days off.

Do any of the above statements sound like you? Then you’re likely overworking and on a surefire path to burnout.

We’re all busy. Whether it’s responsibilities at home or work, or just daily life hustle, many of you focus so much on “doing it all” and you forget to focus on yourself.

Amidst all of this, ensuring your physical and mental health ,and happiness is critical.

I learned the hard way the need to pause and take a moment to reflect on day to day things I do.

All this while, I realized the importance of slowing things down and taking a much-needed break. And you should too.

You can’t rush a cherry blossom.

Make yourself a priority once in a while. It’s not selfish, it’s necessary.

Below are the things can help you rewind and rejuvenate:

1- Schedule breaks between your work as you schedule any other important meetings.

2- Put out 2–3 hours every week to learn and think.

3- Eliminate distractions to focus on time-sensitive work.

4- Reduce meetings and clean your calendar.

5- Create templates to maximize productivity and to reduce repetitive tasks.

6- Don’t let perfection be your enemy.

7- Delegate the tasks that you know your team can take it up.

8- Set clear expectation and priority for your team

9- Learn to say No if you feel burn out

10- Separate your identify from your work. You are more than your work, your designation.

“You can do anything, but not everything,” wrote productivity expert David Allen. But few of us listen to that advice.

If you can’t immediately change how much you’re working, you can at least make changes to help you recover from your long days.

Take time to properly recover, both mentally and physically, and you’ll be setting yourself up for more productive days, a better work-life balance, and a happier, healthier life.

Be Bold

Be Courageous

Be Your Best

Subscribe to my weekly (free) newsletter about health, personal development and well-being here https://drthefit.substack.com/

Get my free e-book instantly delivered to your inbox and become healthier, happier, and successful everyday, grab my latest book here.

Read more on work and life:

P.S.: First, you should get my posts in your inbox. Do that here!

Secondly, if you like to experience Medium yourself, consider supporting me and thousands of other writers by signing up for a membership. It only costs $5 per month, it supports us, writers, greatly, and you have the chance to make money with your writing as well.

By signing up with this link, you’ll support me directly with a portion of your fee, it won’t cost you more. If you do so, thank you a million times!

Life Lessons
Work
Writing
Self Improvement
Productivity
Recommended from ReadMedium