avatarAswathi Ashok

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>

A leaf’s hope for compassion

let’s make better choices to prevent the disaster.

Photo by Clay Banks on Unsplash

We waited eagerly for the sun to rise,

and soon, we were showered with abundant supply of light.

We knew, the title “Warriors of our planet” came with great responsibility.

and so, each of us worked hard to do our best to protect life on earth.

As we were aware of being the only species on the planet capable of doing what we did best.

Much of what we did was labelled as photosynthesis by humans.

The roots of our community worked hard to gather water and minerals from the rich soil.

The branches , they helped transport the raw materials collected from the roots to us.

We, were assigned to absorb light from the sun and carbon di oxide from the air.

All put together, was how we prepared Oxygen.

A requirement so crucial, that life on earth depended on it for survival.

Without oxygen , most lives would be dead.

Some called us the warriors, while yet others called us the protectors,

probably because we prepared what they needed for survival,

along with the food our own communities needed to get through the changing seasons.

I was just a tiny leaf when I took up this huge responsibility with great interest in working towards maintaining a healthy balance in nature.

I’ve seen things change with time.

As long as we all lived being conscious,

of the fact that our lives were all interconnected.

Life flourished and was great.

Things started to change when humans decided to function on their own,

slowly cutting us off the equation of balance, disregarding the harmony everyone once maintained.

There was a time, where people once asked us before taking things from us,

Now, they simply took what they wanted.

Like everything belonged to them in the first place.

First they polluted the air, then the waters and now the soil.

O human! All I ask is how far will you go? In the name of development.

Ignoring the damage your kind has caused the rest of the lives on earth.

Photo by Chris LeBoutillier on Unsplash

We battled the polluted air and the polluted waters,

The only place left for us to thrive on was the rich soil.

Now you’ve come to take that away from us too.

We, being the warriors will fight our battles till death,

To protect all the lives that depend on us.

But I wonder, how things will turn out for you.

Haven’t you noticed the amount of carbon di oxide in the air increasing?

Or the insidious rise in temperature?

Reducing levels of Oxygen in the air? everywhere you’ve felled trees in excess.

Did you not know that soil has rich organic carbon content?

Every time human activities affect the soil and the soil degrades, where do you think the carbon stored in soil in different forms, that’s released goes?

It goes straight into the atmosphere itself and you still wonder how all these climatic changes are linked to the soil.

It’s funny how humans are so focused on development,

that they ignore the changes that would actually affect their lives.

Those changes that they have caused themselves,

Those changes that will soon start to wreck their lives.

I’ve already seen so many of our people die miserable deaths,

many others whose lives depended on our people perish.

Each day we live, like it could be our last.

It breaks my heart to see young plants and animals die before us.

But I can’t let go of that tiny voice in me,

that still believes in humans.

That still wonders, “What if humans suddenly decided to be our strength, at this hour of distress?”

“What if humans, one by one choose to live an eco friendly life, to the extent each one of them could?”

“What if, they all chose kindness and compassion for us all?”

“What if, life was as simple as it once was?”

“What if, they loved us like they once did?”

“What If?…”

©Aswathi Ashok 2022. All Rights Reserved.

It’s okay if our actions once affected nature, it’s never too late to make better choices. This is based on the prompts for day 18- leaf and day 19- compassion. This poem combines both these prompts. It’s an effort from my side to create awareness of the soil crisis we are facing right now and why it’s important to do so. Soil crisis is real, and it is not a distant danger anymore. Let’s save soil before it’s too late to reverse the damages we have already done #100daysforsoil #consciousplanet #savesoil #savesoilmovement

Photo by Gabriel Jimenez on Unsplash

Thank you so much for stopping by and taking the time to read my stories. It means a lot to me. If you like reading my fictional stories, please do consider supporting me by joining in as a member on medium, using the link below. What this means is, by signing in as a member you’ll be directly supporting me with a part of your membership fee (5$) and also supporting thousands of other writers on the platform as well

If you decide to join in, please know that I’m truly grateful and I can’t thank you enough for all the effort you put in to support my work as a reader. If you’d like the stories I write to be delivered directly to your email as soon as I publish newer content on medium, subscribe below:

Happy reading!

Savesoil
Soil Health
Stories That Matter
Poetry
Hope
Recommended from ReadMedium