mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
automatically theme mode based on user preference
Related to #1901 Implemented automatic dark theme change based on user preference using the `prefers-color-scheme` media query.
This commit is contained in:
parent
d635cca210
commit
e484d426fe
2 changed files with 11 additions and 0 deletions
3
src/web/App.mjs
Executable file → Normal file
3
src/web/App.mjs
Executable file → Normal file
|
@ -60,6 +60,7 @@ class App {
|
|||
|
||||
this.initialiseSplitter();
|
||||
this.loadLocalStorage();
|
||||
this.manager.options.applyPreferredColorScheme();
|
||||
this.populateOperationsList();
|
||||
this.manager.setup();
|
||||
this.manager.output.saveBombe();
|
||||
|
@ -536,6 +537,8 @@ class App {
|
|||
// Read in theme from URI params
|
||||
if (this.uriParams.theme) {
|
||||
this.manager.options.changeTheme(Utils.escapeHtml(this.uriParams.theme));
|
||||
} else {
|
||||
this.manager.options.applyPreferredColorScheme();
|
||||
}
|
||||
|
||||
window.dispatchEvent(this.manager.statechange);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue