Answers for "dark mode no javascript"

6

javascript detect dark mode

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

css dark mode

@media (prefers-color-scheme: dark) {
  body {
    background-color: black;
    color: white;
  }
}
Posted by: Guest on September-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language