Skip to content

Commit

Permalink
Move theme setting code into a block
Browse files Browse the repository at this point in the history
This makes a bit more sense, since it's the only "thing" contained in
the body tag.
  • Loading branch information
pradyunsg committed Apr 7, 2022
1 parent aa04cd6 commit 58db5b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/furo/theme/furo/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@
{%- block extrahead -%}{%- endblock -%}
</head>
<body>
{% block body %}
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
{% block body %}{% endblock %}
{% endblock %}

{%- block scripts -%}

Expand Down
1 change: 1 addition & 0 deletions src/furo/theme/furo/page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}

{% block body -%}
{{ super() }}
{% include "partials/icons.html" %}

<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
Expand Down

0 comments on commit 58db5b8

Please sign in to comment.