if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { console.log(` is dark`); }else{ console.log(`shiit is light`); }