I attempted to deploy a Dark Mode following the advice on the community by @artur, from this code, which I inserted into the footer of my website. I don’t understand it doesn’t work
<script src="<https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js>"></script>
<script>
function addDarkmodeWidget() {
new Darkmode().showWidget();
}
window.addEventListener('load', addDarkmodeWidget);
</script>
I get this error in Google Chrome Console
Uncaught ReferenceError: Darkmode is not defined at addDarkmodeWidget
(sorry to respond to an ancient thread…)
This works great for our purposes! Are there ways to tweak settings in dark mode? There are some blocks that are pure black for example that I might like to be slightly lighter, or some text that could be different colors.
Hi,
There might be ways, but I haven’t looked into it as it is never requested by my clients. This dark mode comes from a library I haven’t checked in a long time.