mirror of
https://github.com/mue/mue.git
synced 2026-07-13 20:13:47 +02:00
refactor: improve dark theme, add switch component etc, fix stuff
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
@@ -50,9 +50,9 @@ export default class SettingsFunctions {
|
||||
|
||||
// Set theme depending on user preferred
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
localStorage.setItem('darkTheme', true);
|
||||
localStorage.setItem('theme', 'dark');
|
||||
} else {
|
||||
localStorage.setItem('darkTheme', false);
|
||||
localStorage.setItem('theme', 'light');
|
||||
}
|
||||
|
||||
// Languages
|
||||
@@ -123,6 +123,11 @@ export default class SettingsFunctions {
|
||||
document.body.style.zoom = zoom + '%';
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('theme');
|
||||
if (theme === 'dark') {
|
||||
document.body.classList.add('dark');
|
||||
}
|
||||
|
||||
// easter egg
|
||||
console.log(`
|
||||
█████████████████████████████████████████████████████████████
|
||||
|
||||
Reference in New Issue
Block a user