Skip to content
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

Fix scroll and put nav visually "in front" for narrow/mobile screens #863

Merged
merged 3 commits into from
Oct 24, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions assets/html/documenter.css
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ article section.docstring a.source-link {
@media only screen and (max-width: 768px) {
nav.toc {
position: fixed;
overflow-y: scroll;
width: 16em;
left: -16em;
-webkit-overflow-scrolling: touch;
Expand All @@ -513,6 +512,11 @@ article section.docstring a.source-link {
-webkit-transition-timing-function: ease-out; /* Safari */
transition-timing-function: ease-out;
z-index: 2;
box-shadow: 5px 0px 5px 0px rgb(210,210,210);
}

nav.toc > ul {
overflow-y: scroll;
Copy link
Contributor Author

@dalum dalum Oct 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle, I think we could just use overflow-y: auto, so the scroll bar only shows up when needed. But I don't know if there was a rationale behind using scroll on nav.toc before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think auto looks better actually. The scrollbar, at least with the -webkit-* styling I applied, creates this visible bar next to the currently selected item part, which nicely goes away if there is no need for a scrollbar.

}

nav.toc.show {
Expand Down Expand Up @@ -560,7 +564,7 @@ article section.docstring a.source-link {
}

article > header div#topbar span {
position: fixed;
position: relative;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The position: fixed has always seemed like a bug to me on mobile. I think this is the correct fix to make it properly hide along with the menu when scrolling.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to work properly like this (on Chrome), but I agree that it doesn't make much sense logically. As we're not setting any position values, couldn't we get rid of position altogether?

width: 80%;
height: 1.5em;
margin-top: -0.1em;
Expand Down