-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve css so anchor don't go under sidebar #638
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
Conversation
Hi, thanks for opening this! While this certainly fixed the issue, it slightly breaks other functionality:
The changes also must go into the Stylus files, otherwise the changes will be overwritten during the build step (see https://github.com/rust-lang-nursery/mdBook/blob/master/CONTRIBUTING.md#making-changes-to-the-style for a guide). |
The sidebar never hid when scrolling down for me... I'll fix the other issues. |
I think it only hides when the sidebar is hidden. |
Ah that's why! Then it's an easy fix. |
|
||
.sidebar-visible .content { | ||
position: absolute | ||
top: 52px |
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.
Not sure how well this will scale - the header may have a different size depending on font settings (it's 51px
on my machine).
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.
It's 52 on mine haha.
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.
Can't you define it as something like 3 em
to make sure the size scales appropriately? I imagine hard-coding the size is probably going to make a difference when people view things on mobile.
@@ -2,20 +2,18 @@ | |||
|
|||
.page-wrapper { | |||
box-sizing: border-box | |||
left: 0 | |||
position: absolute |
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.
Don't really dig having position: absolute
, but can't think of another way to do it either.
7770848
to
dd2523a
Compare
Ok, should be fine. |
When clicking on anchors, they don't go under the top navbar now.