08.03.2024, 09:18
Add this to Custom JavaScript:
Create a dummy object and attach a visualization element to it. Set Additional classes to toggle-dark-mode
Clicking this element will toggle between light/dark mode. This setting is stored in browser's local storage.
Code:
$(function(){
if (window.Storage) {
var dark = !!Storage.get('darkmode', '');
$('body').toggleClass('dark', dark);
$('.toggle-dark-mode').off('vclick').on('vclick', function() {
dark = !dark;
Storage.set('darkmode', dark ? 'y' : '');
$('body').toggleClass('dark', dark);
});
}
});
Create a dummy object and attach a visualization element to it. Set Additional classes to toggle-dark-mode
Clicking this element will toggle between light/dark mode. This setting is stored in browser's local storage.