1
0
Fork 0

Merge pull request #63 from jtagcat/ui.systemUsesDarkTheme

Add support for prefers-color-scheme: dark.
This commit is contained in:
南小北 2020-08-18 23:46:15 +08:00 committed by GitHub
commit 7545a57c52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@
let sunset; let sunset;
function setBodyClass() { function setBodyClass() {
if (now > sunrise && now < sunset) return; if (window.matchMedia("(prefers-color-scheme: dark)").matches || now > sunrise && now < sunset) return;
document.body.classList.add('dark'); document.body.classList.add('dark');
} }