feat: dark mode switch
This commit is contained in:
@@ -10,20 +10,6 @@
|
||||
|
||||
<script src="https://unpkg.com/htmx.org@2.0.3"></script>
|
||||
|
||||
<script>
|
||||
function switchTheme() {
|
||||
const theme = localStorage.getItem('theme')
|
||||
|
||||
if (theme === 'dark') {
|
||||
document.documentElement.classList.remove('dark')
|
||||
localStorage.setItem('theme', 'light')
|
||||
} else {
|
||||
document.documentElement.classList.add('dark')
|
||||
localStorage.setItem('theme', 'dark')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{% tailwind_css %}
|
||||
{% block extra_js %}
|
||||
{% endblock %}
|
||||
@@ -35,4 +21,6 @@
|
||||
{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
|
||||
<script src="{% static 'theme/js/theme.js' %}"></script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user