Files
zulip/static/js/night_mode.js
MariaGkoulta b10f156250 settings: Add automatic theme detection feature.
With this implementation of the feature of the automatic theme
detection, we make the following changes in the backend, frontend and
documentation.

This replaces the previous night_mode boolean with an enum, with the
default value being to use the prefers-color-scheme feature of the
operating system to determine which theme to use.

Fixes: #14451.

Co-authored-by: @kPerikou <44238834+kPerikou@users.noreply.github.com>
2020-06-21 01:09:01 -07:00

14 lines
386 B
JavaScript

exports.enable = function () {
$("body").removeClass("color-scheme-automatic").addClass("night-mode");
};
exports.disable = function () {
$("body").removeClass("color-scheme-automatic").removeClass("night-mode");
};
exports.default_preference_checker = function () {
$("body").removeClass("night-mode").addClass("color-scheme-automatic");
};
window.night_mode = exports;