Merge branch 'dark-mode' into staging

This commit is contained in:
Marie Birner 2023-11-04 20:53:29 +01:00
commit 48f26a1379
2 changed files with 9 additions and 11 deletions

View File

@ -77,11 +77,10 @@ function colorThemeWatcher() {
function setTheme(theme: string, setLocalStorage = true) {
let toggleBtn = document.querySelector('#theme-toggle-js');
if(toggleBtn) {
if (setLocalStorage) {
localStorage.setItem('theme', theme);
}
toggleBtn.setAttribute('data-theme', theme);
if (toggleBtn) toggleBtn.setAttribute('data-theme', theme);
if (document.documentElement.classList.contains('dark') && theme === 'light') {
document.documentElement.classList.remove('dark');
@ -89,7 +88,6 @@ function setTheme(theme: string, setLocalStorage = true) {
document.documentElement.classList.add('dark');
}
}
}
function setCurrentdate(input: HTMLInputElement) {
if(input) {

View File

@ -30,7 +30,7 @@
</header>
{% endif %}
<div class="flex min-h-screen {%if not loggedin_user and not show_kiosk_header %} items-center {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8"> {% block content %}{% endblock content %}
<div class="flex min-h-screen {%if not loggedin_user and not show_kiosk_header %} items-center dark:bg-primary-900 {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8"> {% block content %}{% endblock content %}
</div>
{% if loggedin_user %}