mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
* in1abc30a760the hardcoding of ="dark" (during development) was accidentally checked in; it never should have been. * ine14b3eaaa6I mixed up the bare*base templates. It's actually bare_base.html that's for 404/500 etc; barest_base is more bare visually (it's the box-based layout for login etc), but it doesn't need to be so careful not to use variables. See #40
35 lines
1.2 KiB
HTML
35 lines
1.2 KiB
HTML
{% load static tailwind_tags %}<!DOCTYPE html>{# copy of bare_base.html, but without even a menu bar #}
|
|
<html lang="en" data-theme="{% if user.is_authenticated %}{{ user.theme_preference }}{% else %}system{% endif %}">
|
|
<head>
|
|
<title>{% block title %}Bugsink{% endblock %}</title>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
{% tailwind_preload_css %}
|
|
{% tailwind_css %}
|
|
<script>
|
|
// System theme detection and switching
|
|
(function() {
|
|
const html = document.documentElement;
|
|
function applySystemTheme() {
|
|
if (document.documentElement.getAttribute('data-theme') === 'system') {
|
|
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
html.setAttribute('data-theme', isDark ? 'dark' : 'light');
|
|
}
|
|
}
|
|
applySystemTheme();
|
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', applySystemTheme);
|
|
})();
|
|
</script>
|
|
</head>
|
|
|
|
<body class="dark:bg-slate-700 dark:text-slate-100">
|
|
<div id="content">
|
|
<div>
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html>
|