mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 06:15:13 +03:00
Fix forced dark mode if dark mode on OS level
This commit is contained in:
parent
2395c7a216
commit
f397cbcd2d
6 changed files with 33 additions and 37 deletions
|
@ -27,14 +27,14 @@ var css_dark = [
|
|||
]
|
||||
|
||||
var DarkTheme = {
|
||||
configEnabled: false,
|
||||
configEnabled: undefined,
|
||||
};
|
||||
|
||||
DarkTheme.setConfig = function(result) {
|
||||
if (this.configEnabled != result) {
|
||||
this.configEnabled = result;
|
||||
|
||||
if (this.configEnabled) {
|
||||
if (this.configEnabled === 0 || this.configEnabled === 2 && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
this.applyDark();
|
||||
} else {
|
||||
this.applyNormal();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue