Now the next step would be that our entire website detects whether Mode Dark or Light is enabled, for that we can use the following plugins: Advanced Scripts, Scripts Organizer or Code Snippets.
Just copy the Javascript code below.
const currentTheme = localStorage.getItem('theme');
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'dark') {
toggleSwitch.checked = true;
}
}