-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(theme/stylus/menu): Make sticky #551
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
feat(theme/stylus/menu): Make sticky #551
Conversation
I dunno, I kinda like the ghostly effect where the menu buttons just float on top of the page. What about trying it then taking a screenshot so we can see how things look with and without the border?
Hmm... Wouldn't that kinda defeat the purpose of having the menu sticky? |
Don't think so. It would save screen space when reading (scrolling down). As soon as you want to reach for the header actions and start scrolling up (let's say more than 10px), the header would appear, saving you from the trouble of swiping multiple times to reach it. |
Ah okay, I understand what you're talking about. For non-mobile users, can we also add a way that it'll show itself if you move your mouse up to the top of the page as well? Similar to what we currently do with fading in/out the title. It'd be annoying to lose your header on a laptop and then have to scroll up to show it again, whereas that's a pretty natural operation on mobile. |
That might prove to be annoying - if I want to click on a link on the top of the page just to find that the menu gets in the way. I've added the bottom border and the autohide functionality when scrolling up, let me know what you think. |
Why exactly do we do that? I find it kind of strange, there is this big gap up there. |
I just checked this PR out onto my laptop and I think the overall idea is pretty good. I'm not so certain about adding a bottom border to the menu bar though, it kinda breaks up the page and puts the content in a box, making it feel less "fluid"... Does that make sense?
I think it's for similar reasons to why we're hiding the menu when you scroll down. To keep the UI as free of clutter as possible. If we're autohiding the menu I think we should remove the fade in/out effect, seeing as it's now redundant.
After experimenting a bit, I think this works alright. Once you're reading, you don't usually want to touch anything on the menu anyway. |
It does. One thing we could try is show it only when the menu is sticky (
👍
|
Alright, implemented show-on-hover. It leads to some more complicated selectors though: html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-container My only concern is how will this feel on mobile devices, where |
I just tried this out on my laptop and I think you've found a happy middle ground 👍 The header will remain shown when you've got the sidebar open, but then when it's closed you go into an "uncluttered reading mode" where everything tries to get out of your way and just show you the chapter content. As you said might happen, it can sometimes be annoying trying to click a link which is within the top 50px or so. Depending on how often people encounter that it may turn into a papercut. I also tried it out on my mobile and found hiding the top bar when you scroll down quite intuitive. It matches the behaviour of lots of other mobile sites. I'm pretty happy with this PR. Is there anything else you'd like to do, or is it ready to merge? |
No, I would say this is all for now. |
* feat(theme/stylus/menu): Make sticky * feat(theme/stylus/menu): Faint bottom border * feat(theme/book): Auto hide menu when scrolling down * feat(theme/stylus/menu): Don't hide title * feat(theme/stylus/menu): Only show bottom border when sticky * fix(theme/stylus/menu): Don't hide when sidebar is expanded * feat(theme/book): Show menu bar on hover
Questions:
Closes #545.