v2.ocaml.org icon indicating copy to clipboard operation
v2.ocaml.org copied to clipboard

Fixed sidebar for all TOCs

Open dldisha opened this issue 3 years ago • 6 comments

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
  • [x] PR is descriptively titled and links the original issue above
  • [x] Before/after screenshots (if this is a layout change)
  • [x] Details of which platforms the change was tested on (if this is a browser-specific change)
  • [x] Context for what motivated the change (if this is a change to some content)

dldisha avatar Apr 05 '21 22:04 dldisha

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

avsm avatar Apr 06 '21 18:04 avsm

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

dldisha avatar Apr 06 '21 18:04 dldisha

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 avatar Apr 07 '21 18:04 avsm

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

dldisha avatar Apr 08 '21 22:04 dldisha

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 avatar Apr 19 '21 12:04 avsm

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

https://user-images.githubusercontent.com/26017359/115300435-97851f80-a17d-11eb-8736-801690b414ee.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.

dldisha avatar Apr 19 '21 20:04 dldisha