Skip to content

Fixed sidebar for all TOCs #1423

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

dldisha
Copy link

@dldisha dldisha commented Apr 5, 2021

Issue Description

For all the pages having a Table of Contents section, we can style it as a fixed sidebar for easy navigation and usability. The user wouldn't have to scroll up or down to explore other topics directly go to the desired sub-part.

Fixes #1363

Changes Made

I have done styling changes in the nav-secondary class.

Before:
Screenshot from 2021-04-02 01-08-23

After:
Screenshot from 2021-04-02 01-25-28

  • Please check if the PR fulfills these requirements
  • PR is descriptively titled and links the original issue above
  • Before/after screenshots (if this is a layout change)
  • Details of which platforms the change was tested on (if this is a browser-specific change)
  • Context for what motivated the change (if this is a change to some content)

@avsm
Copy link
Member

avsm commented Apr 6, 2021

This is definitely a good idea in principle, but there is a vertical overflow problem on a larger width. Would you be able to look into that?

image

@dldisha
Copy link
Author

dldisha commented Apr 6, 2021

Sure, I'll look into it and make the necessary changes.

@avsm
Copy link
Member

avsm commented Apr 7, 2021

Thanks @dldisha! Ping this issue when you push a fix, and I'll sync it back to the staging site with your changes after that.

@avsm avsm removed the pushed-to-staging pushed to staging.ocaml.org label Apr 7, 2021
@dldisha
Copy link
Author

dldisha commented Apr 8, 2021

@avsm probably now the overflow problem is resolved. Please review it :)

@avsm avsm added the pushed-to-staging pushed to staging.ocaml.org label Apr 15, 2021
@avsm
Copy link
Member

avsm commented Apr 19, 2021

I'm afraid it's the same for me (see screenshot). If you do push a fix, I'd recommend also posting updated before/after screenshots to indicate how it looks for you.

image

@avsm avsm marked this pull request as draft April 19, 2021 12:14
@avsm avsm removed the pushed-to-staging pushed to staging.ocaml.org label Apr 19, 2021
@dldisha
Copy link
Author

dldisha commented Apr 19, 2021

I noticed that the overflow is happening because of different screen sizes.

vertical-overflow.mp4

@avsm can I use javascript to resolve this? The script will make sure that the floating sidebar has stopped when the endpoint has reached. I don't know if it will disturb the OMD or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixed sidebar in Learn page
2 participants