aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/action-popup-main.js
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-06-18 14:00:52 -0400
committerGitHub <noreply@github.com>2024-06-18 18:00:52 +0000
commitebd911201df0e6fce95b408935fb35580851170e (patch)
tree1955088b5c5157a02b1d75d8994e20114199830c /ext/js/pages/action-popup-main.js
parent129be78c9bf1b9d378050c6ca6ec722ef456c4ee (diff)
Add full dark mode support (#1079)
* Add full dark mode support * Fix welcome, permissions, and quick start scrollbars * Fix action popup dark mode on mobile * Add theme to info page * Reduce flashbang * Move position of settingsDisplayController to not break things * Fix dictionary import drag drop theming * Make dark shadow color less bad * Prepare themeController to avoid not being able to set browser theme
Diffstat (limited to 'ext/js/pages/action-popup-main.js')
-rw-r--r--ext/js/pages/action-popup-main.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/js/pages/action-popup-main.js b/ext/js/pages/action-popup-main.js
index cdf8f328..ce29bcf1 100644
--- a/ext/js/pages/action-popup-main.js
+++ b/ext/js/pages/action-popup-main.js
@@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import {ThemeController} from '../app/theme-controller.js';
import {Application} from '../application.js';
import {getAllPermissions, hasRequiredPermissionsForOptions} from '../data/permissions-util.js';
import {querySelectorNotNull} from '../dom/query-selector.js';
@@ -30,10 +31,15 @@ class DisplayController {
this._api = api;
/** @type {?import('settings').Options} */
this._optionsFull = null;
+ /** @type {ThemeController} */
+ this._themeController = new ThemeController(document.documentElement);
}
/** */
async prepare() {
+ this._themeController.siteTheme = 'light';
+ this._themeController.prepare();
+
const manifest = chrome.runtime.getManifest();
this._showExtensionInfo(manifest);
@@ -201,6 +207,9 @@ class DisplayController {
}
void this._updateDictionariesEnabledWarnings(options);
void this._updatePermissionsWarnings(options);
+
+ this._themeController.theme = options.general.popupTheme;
+ this._themeController.updateTheme();
}
/** */