1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-26 10:05:10 +00:00
This commit is contained in:
zumbiepig
2024-09-03 20:24:37 -07:00
parent 4daef0ece7
commit 286ac4fa63
3 changed files with 4 additions and 8 deletions

View File

@@ -6,11 +6,7 @@ let selectedVersion: string;
const theme = {
load: function (themeToLoad?: string) {
const themeElement = document.getElementById('theme') as HTMLLinkElement;
if (themeElement) {
document.documentElement.style.display = 'none';
themeElement.onload = () => (document.documentElement.style.display = '');
themeElement.href = themeToLoad ? `/resources/styles/themes/${themeToLoad}.css` : `/resources/styles/themes/${storage.local.get('theme') ?? 'default'}.css`;
}
if (themeElement) themeElement.href = themeToLoad ? `/resources/styles/themes/${themeToLoad}.css` : `/resources/styles/themes/${storage.local.get('theme') ?? 'default'}.css`;
},
set: function (newTheme: string) {
storage.local.set('theme', newTheme);