mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
14 lines
538 B
HTML
14 lines
538 B
HTML
{% extends "!layout.html" %}
|
|
{% block extrahead %}
|
|
<script>
|
|
// MediaQueryList object
|
|
const prefersDarkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
const lsDark = localStorage.getItem("dark-mode");
|
|
let darkModeState = lsDark !== null ? lsDark == "true" : prefersDarkQuery.matches;
|
|
|
|
document.documentElement.classList.toggle("dark-mode", darkModeState);
|
|
document.documentElement.classList.toggle("light-mode", !darkModeState);
|
|
</script>
|
|
{{ super() }}
|
|
{% endblock %}
|