Skip to content

Commit

Permalink
fixed color falsh with dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Kueng committed Oct 21, 2023
1 parent 781da8c commit ccc5554
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions app/munkiwebadmin/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@

<title>{{ APPNAME }}</title>

<script charset="utf-8">
(function () {
// immediately set the theme mode to avoid flashes
var systemTheme = window.matchMedia("(prefers-color-scheme: dark)");
var theme = localStorage.getItem('theme') || (systemTheme.matches ? 'dark' : 'light');
document.getElementsByTagName('html')[0].setAttribute('data-bs-theme', theme);
})()
</script>

{% load static %}
<!-- Bootstrap Core CSS -->
<script type="module" src="{% get_static_prefix %}js/color-modes.js"></script>
<link rel="stylesheet" href='{% get_static_prefix %}css/munkiwebadmin.css' type="text/css" media="all" />
<link rel="stylesheet" href='{% get_static_prefix %}css/bootstrap.css' type="text/css" media="all" />
<link rel="stylesheet" href='{% get_static_prefix %}css/dataTables.bootstrap5.min.css' type="text/css" media="all" />
<link rel="stylesheet" href='{% get_static_prefix %}css/responsive.bootstrap5.min.css' type="text/css" media="all" />

<!-- Custom Fonts -->
<link href="{% get_static_prefix %}fonts/fontawesome/css/all.min.css" rel="stylesheet" type="text/css">

<!-- custom CSS -->
<link rel="stylesheet" href='{% get_static_prefix %}css/munkiwebadmin.css' type="text/css" media="all" />

{% block extra_style %}{% endblock %}

<script type="module" src="{% get_static_prefix %}js/color-modes.js"></script>


<!-- static/media url for js -->
<script>
Expand Down

0 comments on commit ccc5554

Please sign in to comment.