Skip to content

Commit

Permalink
clients(devtools): ignore dark mode media query (#9082)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored and brendankenny committed May 30, 2019
1 parent a11dec4 commit 9a011a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lighthouse-core/report/html/renderer/report-ui-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class ReportUIFeatures {
topbarLogo.addEventListener('click', () => this._toggleDarkTheme());

let turnOffTheLights = false;
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
// Do not query the system preferences for DevTools - DevTools should only apply dark theme
// if dark is selected in the settings panel.
if (!this._dom.isDevTools() && window.matchMedia('(prefers-color-scheme: dark)').matches) {
turnOffTheLights = true;
}

Expand Down

0 comments on commit 9a011a5

Please sign in to comment.