DEV Community

loading...

Discussion on: Simple Dark-Light theme with VanillaJs

Collapse
casiimir profile image
casiimir • Edited

Nice done, I love it!
Can I suggest three more lines of javascript? :D

...
let isLight = true;
...

function modeSwitch() {
...
  isLight = !isLight;
  isLight ? toggle.innerText = "🌞" : toggle.innerText = "🌚";
}
Enter fullscreen mode Exit fullscreen mode
Collapse
vaishnavme profile image
Vaishnav Author

Hey. I updated pen according to your suggestions. Thanks 🤩.

Collapse
casiimir profile image
casiimir • Edited

Really? I'm honored! :D

Thread Thread
vaishnavme profile image
Vaishnav Author • Edited

Yep. I'm still learning and I love to share what learned hoping it would be helpful for someone.😄

Thread Thread
casiimir profile image
casiimir

Me too, same story!
Nice website, I like it. Do you like something about my repos? :D

Thread Thread
vaishnavme profile image
Vaishnav Author

I checked repos... You have awesome portfolio 🔥.

Thread Thread
casiimir profile image
casiimir

I really appreciate it! :D