Answers for "how to change light mode and dark mode javascript"

6

javascript detect dark mode

const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
Posted by: Guest on July-03-2020
0

javascript detect dark mode

const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches

console.log(isDarkMode) // Result: True or False
Posted by: Guest on September-28-2021

Code answers related to "how to change light mode and dark mode javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language