Answers for "javascript check if dark mode enable"

6

javascript detect dark mode

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

js if dark mode

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
    // dark mode
}
Posted by: Guest on February-15-2021
0

javascript see if chrome is in dark mode

/* Light mode */
@media (prefers-color-scheme: light) {
    body {
        background-color: white;
        color: black;
    }
}
Posted by: Guest on February-07-2021

Code answers related to "javascript check if dark mode enable"

Code answers related to "Javascript"

Browse Popular Code Answers by Language