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

Remove toc sidebar when page-toclevels is -1 #251

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

recrwplay
Copy link
Collaborator

At narrow page widths, when the main TOC is still visible, setting :page-toclevel: -1 results in no in-page 'Contents' being displayed, but the HTML elements are still present, taking up width.

This can produce inconsistent page appearance:

  • pages with no headings use the available width
  • pages with headings, but the 'Contents' section removed use the width minus the width of the <aside>.

Note that this change has no effect on the page layout once the <article> (the main page content) reaches its maximum width.

Copy link

netlify bot commented Aug 5, 2024

Deploy Preview for neo4j-docs-ui ready!

Name Link
🔨 Latest commit 71ac7b2
🔍 Latest deploy log https://app.netlify.com/sites/neo4j-docs-ui/deploys/66b12448e4f2150008008d70
😎 Deploy Preview https://deploy-preview-251--neo4j-docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stefano-ottolenghi
Copy link
Contributor

stefano-ottolenghi commented Aug 13, 2024

I'm not sure I understand the change. With no ToC, the content is still limited to page width - ToC -- it doesn't fill up the whole width, including that left by the vanished ToC.

Screenshot from 2024-08-13 18-04-20
Screenshot from 2024-08-13 18-04-10

@recrwplay
Copy link
Collaborator Author

This PR addresses instances from the breakpoint at 1024px where the left and right ToC visibility on the page is toggled. Between this breakpoint and the width at which the page content reaches its maximum width, a ToC that is hidden by using :page-toclevels: -1 on the page was still taking up space.

Screenshot 2024-08-14 at 10 29 01

Once the content reaches its current maximum, I don't think we should expand it into the space used by the ToC (essentially: readability and consistency). An exception to this is where the page displays tables (and really, tables only) and where the tables would be more readable if the page uses the full width. I opened #214 (some time ago) with that in mind.

@stefano-ottolenghi
Copy link
Contributor

Ah, okay, I had misunderstood its purpose then.

Copy link
Contributor

@stefano-ottolenghi stefano-ottolenghi left a comment

Choose a reason for hiding this comment

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

LGTM.

@recrwplay recrwplay merged commit 087859e into master Aug 15, 2024
5 checks passed
@recrwplay recrwplay deleted the page-toclevels-width branch November 27, 2024 10:07
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.

2 participants