Not working.
You can check the menu in header “Dark mode” in this website ticonnect .net
I’m trying to add onclick=”toggleLight() in order to let users turn into dark or light mode.
Script used :
<script src=”https://cdn.jsdelivr.net/npm/[email protected]/darkreader.js” integrity=”sha256-ESc/02WWPMS6nHR51aorY6avazveX90YL/h6tca4GQo=” crossorigin=”anonymous”></script>
<script>
var light = false;
function toggleLight() {
if(!light){
DarkReader.enable({
brightness: 100,
contrast: 90,
sepia: 10
});
light = true;
}else{ //this will only be executed once
DarkReader.disable();
light = false;
}
}
</script>