{% 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 %}
