User:Ezn/common.js

window.onload= => { const darkThemeMq = window.matchMedia('(prefers-color-scheme: dark)'); darkThemeMq.addListener(function(e) {	 if (e.matches) {		console.log('DARK MODE');		document.documentElement.classList.add('nighttime');	 } else {		document.documentElement.classList.remove('nighttime');	 }	}); }