<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Neeraj M R</title>
    <description>The latest articles on DEV Community by Neeraj M R (@neerajram30).</description>
    <link>https://dev.to/neerajram30</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F799292%2F566f7fb5-fc01-4996-9665-4610ca4821eb.jpg</url>
      <title>DEV Community: Neeraj M R</title>
      <link>https://dev.to/neerajram30</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neerajram30"/>
    <language>en</language>
    <item>
      <title>Easy way to use Dark Mode with custom style in Next.js + Tailwind</title>
      <dc:creator>Neeraj M R</dc:creator>
      <pubDate>Wed, 02 Feb 2022 13:45:37 +0000</pubDate>
      <link>https://dev.to/neerajram30/how-to-customize-dark-mode-in-nexjs-tailwind-2pn8</link>
      <guid>https://dev.to/neerajram30/how-to-customize-dark-mode-in-nexjs-tailwind-2pn8</guid>
      <description>&lt;p&gt;I was building my porfolio website in &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Nextjs&lt;/a&gt; using &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Tailwind css&lt;/a&gt;. So I decided to implement a toggle between dark and light theme in my wesite. So I started googling it and end up with a blog post in &lt;a href="https://dev.to/thomasledoux1/easy-way-to-use-dark-mode-in-next-js-tailwind-2ob1"&gt;dev.to&lt;/a&gt;. This is an excellent blog post. By refering this post I was able to implement this feature in 2, 3 lines of code. &lt;/p&gt;

&lt;p&gt;But the doubt came to my mind was. How to use customised styles for dark and light themes using tailwindcss classes ?&lt;br&gt;
I am a begginer to Nextjs and tailwindss, so it take me so many time to find a better solution. I coun't find any simple documentation. So I decided to write this blog post to share my solution.&lt;/p&gt;

&lt;p&gt;Detailed article on how to implement toggled Dark and Light mode is given in &lt;a href="https://dev.to/thomasledoux1/easy-way-to-use-dark-mode-in-next-js-tailwind-2ob1"&gt;this&lt;/a&gt; documentation.&lt;/p&gt;

&lt;p&gt;So after implementing dark/light mode toggle. We can customize our website using &lt;strong&gt;theme&lt;/strong&gt; as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; 
&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text-blue-600&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text-rose600&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;Example&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it!! its so easy to customize the theme in our Nextjs website. &lt;/p&gt;

&lt;p&gt;You can find me on &lt;a href="https://github.com/neerajram30" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
