[Vuejs]-Nuxt js & Vue : The best way to implement a light / Dark mode in a relatively large project?

0👍

Maybe you can give a try to the nuxt community module: https://github.com/nuxt-community/color-mode-module

Demo web site : https://color-mode.nuxtjs.app/

0👍

@Ifaruki How can this be used in Vue JS components? For example, suppose we want to change the value of the variables in the root by pressing a button in the header? How should we write this method? Suppose there are 10 variables in root and we want to change all 10 variables by pressing a button, how should we do that?

Basically, is this the right way to make dark / light, and does it work well? Is this method correct?

root.style.setProperty(‘–background’, “green”);

Leave a comment