2020-08-27 13:46:34 +02:00
|
|
|
// Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
2023-05-26 04:49:44 +02:00
|
|
|
/** Add night-mode class to documentElement if hash location is #night, and
|
|
|
|
return true if added. */
|
2020-08-27 13:46:34 +02:00
|
|
|
export function checkNightMode(): boolean {
|
|
|
|
const nightMode = window.location.hash == "#night";
|
|
|
|
if (nightMode) {
|
|
|
|
document.documentElement.className = "night-mode";
|
2023-07-01 08:21:53 +02:00
|
|
|
document.documentElement.dataset.bsTheme = "dark";
|
2020-08-27 13:46:34 +02:00
|
|
|
}
|
|
|
|
return nightMode;
|
|
|
|
}
|