DEV Community

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

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

joyshaheb profile image Joy Shaheb Updated on ・1 min read

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 ❤️️

Discussion (1)

pic
Editor guide
Collapse
prolover profile image
sithembiso

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