Similar to \"How to detect if OS X is in dark mode?\" only for browsers.
Has anyone found if there is a way to detect if the user\'s system is in the new OS X Dark M
According to Mozilla, here is the preferred method as of 2020
@media (prefers-color-scheme: dark) { body { background: #000; } } @media (prefers-color-scheme: light) { body { background: #fff; } }
For Safari/Webkit you can use
@media (prefers-dark-interface) { background: #000; }