mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
64280579f2
Implement dark mode for UI
12 lines
354 B
JavaScript
12 lines
354 B
JavaScript
window.applyTheme = () => {
|
|
const theme = window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
? "dark"
|
|
: "";
|
|
document.documentElement.setAttribute("theme", theme);
|
|
};
|
|
window
|
|
.matchMedia("(prefers-color-scheme: dark)")
|
|
.addEventListener('change', function () {
|
|
window.applyTheme()
|
|
});
|
|
window.applyTheme(); |