mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-19 12:27:52 +00:00
8 lines
423 B
JavaScript
8 lines
423 B
JavaScript
// Default starts with dark mode.
|
|
document.documentElement.classList.add('dark');
|
|
// Changes theme based on user's device preference when page is loaded.
|
|
if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
document.documentElement.classList.add('dark');
|
|
} else {
|
|
document.documentElement.classList.remove('dark')
|
|
} |