In Javascript from a PAGE and not from the devtools themselves is there currently a way to determine if Chrome's devtools are using dark mode instead of the "normal mode"?
I did find a bug report with a comment about this but it looks like that only relates to Chrome extensions.
No, it's not available from a page.
It is only available for extensions in javascript via:
chrome.devtools.panels.themeName
The name of the color theme set in user's DevTools settings. Possible values:
default
(the default) anddark
.Since Chrome 59.
Source: https://developer.chrome.com/extensions/devtools_panels
So it's technically possible to write an chrome-extension that reads the value and then exposes that to the page via a class or javascript variable.
But requiring your visitors to install an extension for detecting dark mode just isn't practical.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With