Update web/templates/base.html

This commit is contained in:
Joshua Laymon 2025-09-06 02:52:51 +00:00
parent 097fe1bdf0
commit 0eec91e0b9

View File

@ -7,6 +7,23 @@
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{% static 'app.css' %}"> <link rel="stylesheet" href="{% static 'app.css' %}">
{# === THEME SYSTEM (BEGIN) === #}
<link rel="stylesheet" href="{% static 'css/theme-base.css' %}">
<link id="theme-css" rel="stylesheet"
href="{% static 'themes/' %}{{ request.session.theme|default:'midnight' }}.css">
<script>
// Early apply from localStorage to prevent flash if a user-selected theme exists
(function () {
try {
var stored = localStorage.getItem('theme');
if (stored) {
document.getElementById('theme-css').href = '{% static "themes/" %}' + stored + '.css';
}
} catch (e) {}
})();
</script>
{# === THEME SYSTEM (END) === #}
<!-- === PWA additions (BEGIN) === --> <!-- === PWA additions (BEGIN) === -->
<link rel="manifest" href="/manifest.webmanifest"> <link rel="manifest" href="/manifest.webmanifest">
<meta name="theme-color" content="#f3f6f7"> <meta name="theme-color" content="#f3f6f7">
@ -261,13 +278,6 @@
window.addEventListener('blur', close); window.addEventListener('blur', close);
} }
})(); })();
// Safe to include site-wide; it only adds a class.
(function(){
if (localStorage.getItem("darkMode") === "true") {
document.body.classList.add("dark-mode");
}
})();
</script> </script>
<script> <script>
// Sticky header: add shadow when page is scrolled // Sticky header: add shadow when page is scrolled