avatarSufyan Maan, M.Eng

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 Much Medium Paid Me in 2021

Let’s find out!

Photo by Sasun Bughdaryan on Unsplash

I started my journey on Medium in November 2021 as a reader without knowing it’s possible to write or monetize. I shared my reading habits with my colleagues, family, and friends; they loved my strategies, I thought I should share mine on Linkedin or any writing platform.

I have been reading stories on Medium for more than 2–3 years; however, I published my first story in Nov 2021. Then I completely forgot until Dec. I literally started writing on Medium in Dec to share my expertise. I love to write about productivity, mental wellness, self-improvement, finance, and emerging technology.

I was accepted into the Medium partner program on Dec 9th, 2021. Technically my first day to earn some money started on Dec 10th, 2021.

Here is the money I made in 20 days on Medium. I was not consistent in sharing stories. Technically I made $27.44 in 20 days without consistency. Now I am more consistent and taking part in the Medium partner program. Here is the screenshot from the dashboard.

Image by author

As you can see I have to pay 30% tax. I did not know that Canada signed a treaty with the USA government. After that, I updated my tax information to be eligible for 0% tax withholding.

In my first month, or I would say my first 20 days at Medium, I made $27.44, which is not bad because I literally did not know that it was possible to monetize in such a short period.

Now I am more active on the platform and producing 1–2 stories daily by not spending more than 2 hours, including commenting, highlighting, and clapping other great writers. All you have to do is stay consistent! Medium is a great platform to learn and earn.

Key takeaways

I know it’s my 2nd month on Medium, I did not even make $100, but I can foresee the gain.

  • Stay consistent
  • Write at least 1–2 stories every day
  • there is no shortcut to success except hard work
  • Try to help people as much as you can by sharing what you know

Here is a great article I wrote a couple of days ago about getting genuine 250+ followers in a month. You can see my follower’s list in my second month is 431 (at the time of writing this story) and growing rapidly.

Pro tip: Be consistent!

I am also taking part in writing 100 stories in 100 days; if someone wants to jump in, please read the following article. If you have any questions, you can reach out to me.

Thank you for reading, and happy new year!

I hope you enjoyed reading this. If you’d like to support me as a writer, consider signing up to become a Medium member. It’s just $5 a month, and you get unlimited access to Medium.

Medium
Writing
Side Hustle
Make Money Online
New Writers Welcome
Recommended from ReadMedium