Update web/templates/base.html

This commit is contained in:
Joshua Laymon 2025-09-06 03:19:19 +00:00
parent d7a84978d6
commit ee6faf3a11

View File

@ -1,6 +1,6 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-theme="{{ request.session.theme|default:'classic' }}">
<head>
<meta charset="utf-8">
<title>{% block title %}Illustrations{% endblock %}</title>
@ -10,13 +10,14 @@
{# === 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">
href="{% static 'themes/' %}{{ request.session.theme|default:'classic' }}.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.documentElement.setAttribute('data-theme', stored);
document.getElementById('theme-css').href = '{% static "themes/" %}' + stored + '.css';
}
} catch (e) {}