const isDarkMode = () =>
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches;
console.log(isDarkMode());
// true or false
웹 개발 개인 창고
const isDarkMode = () =>
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches;
console.log(isDarkMode());
// true or false