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

Adding bottom to toc #1681

Merged
merged 7 commits into from
Jan 3, 2019
Merged

Adding bottom to toc #1681

merged 7 commits into from
Jan 3, 2019

Conversation

lukasoppermann
Copy link
Contributor

This fixed the toc which is otherwise cut off at the bottom in chrome at least.

This fixed the toc which is otherwise cut off at the bottom in chrome at least.
@RunDevelopment
Copy link
Member

This approach has the problem that when scrolled to the bottom of the page, the TOC is under the footer.

A better (but also more complex) solution would be to move the TOC to the top while scrolling using JavaScript, so that toc.style.top = max(0, header.height - scrolled) + 'px'.

@lukasoppermann
Copy link
Contributor Author

This is true, although I think it is still better than having only half of the nav for the entire time. 😉

@RunDevelopment
Copy link
Member

Sorry for not getting back to you!

My problem is that the TOC will disappear at the end of the page. On smaller screens, this might not be a problem but for larger ones, the end of the page comes to you quickly.

So how about this: We wrap your bottom: 1%; into a media query with (max-height: 800px) so that only smaller screens have the fix.
800px nicely picks up the TOC on all pages that use it.

@lukasoppermann
Copy link
Contributor Author

No worries, I know that everybody is busy, especially around new years. 🎆

Anyway, I think your idea has a problem as well. What do you think of this solution?

screen shot 2019-01-03 at 15 20 37

screen shot 2019-01-03 at 15 20 45

@RunDevelopment
Copy link
Member

RunDevelopment commented Jan 3, 2019

I think your idea has a problem as well.

What problem?


The TOC overlaps part of the page for small screen widths.
It did that before as well but then it wasn't noticeable.

Apart from that, I really like it.

image

@RunDevelopment
Copy link
Member

Seems like this can be fixed by setting the TOC's box-sizing to border-box and its max-width to calc(48% - 450px - 30px).
- 30px for the § anchor marks.

@RunDevelopment
Copy link
Member

Also, what do think about making left and bottom fixed px values?

It's a little awkward to see the TOC move a few pixels as you resize the page.

style.css Outdated Show resolved Hide resolved
@lukasoppermann
Copy link
Contributor Author

Will change it. I prefer px values, just stuck with percentage as it was used before.

@lukasoppermann
Copy link
Contributor Author

Okay, changed it.

  • need to adjust the green checkmarks as they would have been otherwise covered by the very small screen size.
  • moved it flush to the left and removed some padding to make it work on the smallest screen size as well.

style.css Outdated Show resolved Hide resolved
style.css Outdated Show resolved Hide resolved
style.css Outdated Show resolved Hide resolved
@lukasoppermann
Copy link
Contributor Author

Should all be fixed by now.

@RunDevelopment
Copy link
Member

Nice!

Could you please restore the green checkmarks to their former size (400%)? They are not covered anymore, are they?

And please bring back the hover effect. Changing the color instead of the opacity in #toc:hover should do the trick.

@lukasoppermann
Copy link
Contributor Author

Done. 👍

@RunDevelopment
Copy link
Member

I forgot one last thing:

The FAQ page treats the TOC as part of the content section. The cool hover effect shouldn't be there.

@lukasoppermann
Copy link
Contributor Author

Updated the faq.html.

@RunDevelopment RunDevelopment merged commit efdd96c into PrismJS:master Jan 3, 2019
@RunDevelopment
Copy link
Member

Thank you for contributing!

@lukasoppermann
Copy link
Contributor Author

Sure, happy to see it fixed. 😉

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

Successfully merging this pull request may close these issues.

2 participants