For example, if a new user visits the site for the first time, dark mode should be enabled by default using the darkMode: 'class' option.
>Solution :
You’re on the right track. Once you set darkMode: 'class', you need to apply the class="dark" to the element that you want the dark mode applied to.
https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually