mirror of
https://github.com/ankitects/anki.git
synced 2025-11-08 21:57:12 -05:00
12 lines
431 B
TypeScript
12 lines
431 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
/// Add night-mode class to body if hash location is #night, and return
|
|
/// true if added.
|
|
export function checkNightMode(): boolean {
|
|
const nightMode = window.location.hash == "#night";
|
|
if (nightMode) {
|
|
document.documentElement.className = "night-mode";
|
|
}
|
|
return nightMode;
|
|
}
|