1
0
mirror of https://github.com/bitwarden/web synced 2025-12-10 21:33:16 +00:00

Revert "Theme Support with a Dark Mode (#974)" (#1011)

This reverts commit cf24113924.
This commit is contained in:
Chad Scharf
2021-06-03 15:49:14 -04:00
committed by GitHub
parent 2f8a721033
commit a554c0e660
15 changed files with 114 additions and 510 deletions

View File

@@ -167,18 +167,11 @@ export function initFactory(): Function {
authService.init();
const htmlEl = window.document.documentElement;
htmlEl.classList.add('locale_' + i18nService.translationLocale);
const theme = await storageService.get<string>(ConstantsService.themeKey);
let theme = await storageService.get<string>(ConstantsService.themeKey);
if (theme == null) {
htmlEl.classList.add('themeDefaultSet');
} else {
htmlEl.classList.add(theme);
}
if (window.matchMedia('(prefers-color-scheme: dark)').matches && htmlEl.classList.contains('themeDefaultSet')) {
htmlEl.classList.add('themeDark');
}
if (window.matchMedia('(prefers-color-scheme: light)').matches && htmlEl.classList.contains('themeDefaultSet')) {
htmlEl.classList.add('themeLight');
theme = 'light';
}
htmlEl.classList.add('theme_' + theme);
stateService.save(ConstantsService.disableFaviconKey,
await storageService.get<boolean>(ConstantsService.disableFaviconKey));
stateService.save('enableGravatars', await storageService.get<boolean>('enableGravatars'));