website/assets/js/dark-mode.js
2024-03-06 15:19:33 +01:00

4 lines
No EOL
132 B
JavaScript

if (window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
}