Update web/templates/base.html
This commit is contained in:
parent
d7a84978d6
commit
ee6faf3a11
@ -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) {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user