Skip to content

The table of contents should manifest on top of the text, rather than pushing the text over, on mobile #139

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

Closed
david-christiansen opened this issue Nov 4, 2024 · 3 comments
Labels
ASAP To be done as soon as possible HTML/CSS Problems with the HTML or CSS of the manual

Comments

@david-christiansen
Copy link
Collaborator

On mobile devices, opening the table of contents should pop up a menu over the content, rather than pushing the content to the right and sometimes reflowing text:

Screenshot_20241104-113837
Screenshot_20241104-113849

@david-christiansen david-christiansen added ASAP To be done as soon as possible HTML/CSS Problems with the HTML or CSS of the manual labels Nov 4, 2024
@jakobvase
Copy link
Contributor

I would drop the transition that makes it slide in. It is a thing of wonder and beauty, and it looks strange - the text in the toc reflows when you click the button. Also, animations are annoying for some people. Go for simplicity.

@jakobvase
Copy link
Contributor

Once the transition is removed, it's easier to make it float on top of the text, because you don't have to deal with the transforms:

#toc {
    background-color: var(--verso-toc-background-color);
    color: var(--verso-toc-text-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 0;
}

#toc:has(#toggle-toc:checked) {
    width: 15em;
}

@media screen and (max-width: 700px) {
    #toc {
        position: fixed;
        z-index: 10;
    }
}

@david-christiansen
Copy link
Collaborator Author

Fixed in #148. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASAP To be done as soon as possible HTML/CSS Problems with the HTML or CSS of the manual
Projects
None yet
Development

No branches or pull requests

2 participants