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

Hide TOC when it intersects with margin content #170

Open
rowanc1 opened this issue Jul 7, 2023 · 7 comments
Open

Hide TOC when it intersects with margin content #170

rowanc1 opened this issue Jul 7, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@rowanc1
Copy link
Member

rowanc1 commented Jul 7, 2023

image

There is some code @choldgraf has pointed us to here:

https://github.com/executablebooks/sphinx-book-theme/blob/a9794b73cec766e01bee35a96f7d44e22851f278/src/sphinx_book_theme/assets/scripts/index.js#L66

@rowanc1 rowanc1 added the bug Something isn't working label Jul 7, 2023
@choldgraf
Copy link
Member

Note that in the end I didn't make the TOC hide when those two objects overlap directly, but instead opted to make the TOC hide when certain classes of objects were on the screen at all (or 33% up or so), that way the TOC would show and hide preemptively and be less jittery. I think that was a nice balance

@agoose77
Copy link
Collaborator

@rowanc1 I was checking to see whether we implement the margin directive in myst-theme, or other places, and I can't see that we do. However, the above screenshot seems to imply that we did at one point?

In any case, if we don't currently support it, can we close this issue?

@rowanc1
Copy link
Member Author

rowanc1 commented Mar 19, 2024

There are ways to use classes/columns on the blocks to put things in the margins, but it isn't very good to put that burden on the user. I can try and dig up the classes later this week and have a go at implementing the margin directive if you want?

@agoose77
Copy link
Collaborator

@rowanc1 for this issue my question lies around whether MyST currently supports some-way of putting things in the margins. If we do, regardless of user experience, then is the issue raised by @choldgraf still a problem?

Then, for the directive, that's now tracked in #327. I can tackle it in the near term, once I have a sense of what needs doing? Equally happy for you to tackle!

@choldgraf
Copy link
Member

Just sharing the grid system page of the Myst theme docs, which seems to be the recommended way to control things like margins if I understand

https://executablebooks.github.io/myst-theme/?path=/docs/components-grid-system--docs

@agoose77
Copy link
Collaborator

Oh, how did that not turn up in any of my searches 🤦?

Fab, I am now following. We're talking about something like col-margin-right.

@choldgraf
Copy link
Member

choldgraf commented Mar 19, 2024

I had the same challenge haha, the only way I found those Myst theme docs was via the GitHub repo URL link. I should have opened a PR for the dev docs, sorry about that! Will try to do it quickly today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants