mirror of
https://github.com/AJMicke/KickerELO.git
synced 2026-03-12 05:51:05 +01:00
Rotated labels on the graph, and first attempt at dark mode
This commit is contained in:
12
src/main/frontend/prefers-color-scheme.js
Normal file
12
src/main/frontend/prefers-color-scheme.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user