Skip to content

Commit

Permalink
🐛 BUG: fixing sidebar overlap on narrow screens
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Aug 8, 2020
1 parent 6439b66 commit f2c3916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions sphinx_book_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<!-- Docs TOC is "d-none d-xl-block col-xl-2" -->

{% block docs_sidebar %}
<div class="col-12 {{ sidebar_width_class }} bd-sidebar site-navigation show" id="site-navigation">
{% if not is_single_page %}
<div class="col-12 {{ sidebar_width_class }} bd-sidebar site-navigation show{% if is_single_page %} single-page{% endif %}" id="site-navigation"> {% if not is_single_page %}
{% include "sidebar.html" %}
{%- endif %}
</div>
Expand Down
5 changes: 5 additions & 0 deletions sphinx_book_theme/static/sphinx-book-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,11 @@ button.topbarbtn img {
height: 0px !important;
}
}

// If we're only a single page, sidebar should hide at narrow widths.
&.single-page {
display: none;
}
}

@media (min-width: $breakpoint-md) {
Expand Down

0 comments on commit f2c3916

Please sign in to comment.