1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Make the dark / light theme work with PWA (#3883)

Changed the way the dark-theme is loaded. Thanks to @Vitroid for the suggestion.
This commit is contained in:
Míguel Ángel Mulero Martínez 2024-04-10 00:10:08 +02:00 committed by GitHub
parent 4bae72907d
commit be0103f445
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 891 additions and 886 deletions

File diff suppressed because it is too large Load diff

View file

@ -61,12 +61,12 @@ DarkTheme.setConfig = function (result) {
};
DarkTheme.applyDark = function () {
css_dark.forEach((el) => $(`link[href="${el}"]`).prop('disabled', false));
$('body').addClass('dark-theme');
this.enabled = true;
};
DarkTheme.applyNormal = function () {
css_dark.forEach((el) => $(`link[href="${el}"]`).prop('disabled', true));
$('body').removeClass('dark-theme');
this.enabled = false;
};

View file

@ -51,7 +51,7 @@
<link type="text/css" rel="stylesheet" href="./node_modules/multiple-select/dist/multiple-select.min.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./components/EscDshotDirection/Styles.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./css/dark-theme.css" media="all" disabled/>
<link type="text/css" rel="stylesheet" href="./css/dark-theme.css" media="all"/>
<script type="module" src="./js/jquery.js"></script>
<!-- TODO: probably won't need this here once everything is imported -->