website/assets/js/dark-mode.js

4 lines
132 B
JavaScript
Raw Normal View History

2024-03-06 14:19:33 +00:00
if (window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
}