diff --git a/assets/app.scss b/assets/app.scss index 57a48e0c045db2aeba4f0e947a5136a1443ef96e..bd2ea50eebd2bbcaa26f1c65713a1741e3f0b869 100644 --- a/assets/app.scss +++ b/assets/app.scss @@ -19,7 +19,8 @@ pre { .theme-switch { display: inline-block; height: 24px; - position: relative; + position: absolute; + top: 5px; width: 50px; } diff --git a/hiboo/templates/base.html b/hiboo/templates/base.html index 6fdca68c92d3e48279646d00a74388a64ac7812b..ce1e40640dbeb8725912b68eb64df95203243e63 100644 --- a/hiboo/templates/base.html +++ b/hiboo/templates/base.html @@ -33,14 +33,6 @@ </a> </li> {% endif %} - <li class="nav-item"> - <div class="theme-switch-wrapper nav-link"> - <label class="theme-switch" for="checkbox"> - <input type="checkbox" id="checkbox"> - <span class="slider round"></span> - </label> - </div> - </li> </ul> </nav> diff --git a/hiboo/templates/sidebar.html b/hiboo/templates/sidebar.html index 2c8ac5d6542ec270039b9f4fc60a27b5ef8984b2..40632f8aac16cf07a8746ea634077fa54838e1de 100644 --- a/hiboo/templates/sidebar.html +++ b/hiboo/templates/sidebar.html @@ -1,3 +1,14 @@ +<li class="nav-item"> + <a class="nav-link"> + <i class="nav-icon fas fa-moon"></i> + <p>{% trans %}Dark theme{% endtrans %}</p> + <label class="theme-switch ml-3" for="checkbox"> + <input type="checkbox" id="checkbox"> + <span class="slider round"></span> + </label> + </a> +</li> + {% if current_user.is_authenticated %} <li class="nav-header">{% trans %}Account{% endtrans %}</li> <li class="nav-item">