-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: CSS only sidebar toggling #454
Conversation
Curious if @pradyunsg has any other suggestions here, or if this looks mostly reasonable to you :-) cc also @AakashGfude since this restructures a little bit of the HTML |
@@ -9,7 +9,12 @@ | |||
|
|||
<!-- 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{% if is_single_page %} single-page{% endif %}" id="site-navigation"> | |||
<!-- Checkboxes to toggle the left sidebar --> | |||
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an aria-label into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or a labelled-by?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall!
This is updates our left sidebar behavior so that instead of using javascript functions to control the display of the left sidebar with a class, instead we use a CSS input box +
:checked
to toggle its visibility. This will make these pages a bit lighter and less-complex, and make them more robust if wonky things happen with javascript on the page.It also implements Furo-style left sidebar behavior on mobile devices, so that the whole left sidebar pops up in an overlay and you close it by clicking elsewhere on the screen.
Old behavior
(shown on widescreen first, then mobile) (sorry for the red tint)
New behavior
Note that the left TOC closes automatically, because it will be hidden by default on pageload on mobile
Refs
closes #366
closes #355
closes jupyter-book/jupyter-book#1379
closes jupyter-book/jupyter-book#1361
closes jupyter-book/jupyter-book#950