DEV Community

Cover image for Light/Dark Mode Toggle Button Using 1 variable 2021 || CSS JS
Joy Shaheb
Joy Shaheb

Posted on • Edited on

28 7

Light/Dark Mode Toggle Button Using 1 variable 2021 || CSS JS

If you really want your Readers to Read All of your contents, then having a dark mode is a must on your website.

Because, A dark theme reduces the irritation on readers eyes compared to light mode.

Today, we'll make a Scalable dark/light mode toggler button, & we'll do all the calculation's using 1 scss variable.

Table Of Contents 🔥

Codepen 🔥

You can find the full code on Codepen

Youtube Tutorial 🔥

If the codepen is difficult for you then see Step by step Tutorial on Youtube 🔥

Suggestions & Criticisms are Highly Appreciated ❤️️

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (1)

Collapse
 
prolover profile image
sithembiso

can you add code that will remember the mode if I chose to refresh the page

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE