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

✨ ENH: Collapsible sections in the sidebar #349

Merged
merged 8 commits into from
Apr 1, 2021

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Mar 25, 2021

Very much a draft PR, but putting it here to show what I experimented with a while ago.

This basically is a copy the CSS approach (and code) from Furo. I initially started with trying the approach from the sphinx-book-theme, but for some reason (probably just something small), I didn't get the javascript working for that.

We need to decide which approach to use, and then also a lot to clean-up in the PR.

@jorisvandenbossche
Copy link
Member Author

The demo site shows the basics are working: https://pydata-sphinx-theme--349.org.readthedocs.build/en/349/demo/demo.html

@choldgraf
Copy link
Collaborator

choldgraf commented Mar 25, 2021

I think it looks great! We should probably add a few more nested levels here and there in the docs to see how the arrows look (e.g., 2 levels deep, or two nested levels right next to each other, etc).

I've just upgraded to the pydata v0.5 theme in the sphinx book theme: executablebooks/sphinx-book-theme#312

once we get this merged and released, I will remove this section of that theme as well 🎉

@jorisvandenbossche
Copy link
Member Author

jorisvandenbossche commented Mar 26, 2021

I added some more nested pages in the demo docs, and after some fixes, that's looking good now!

@choldgraf
Copy link
Collaborator

choldgraf commented Mar 27, 2021

Awesome, this is looking great. What do you think about adding a lightweight UX to show when people are hovering over the arrow? Something like

ul.bd-sidenav label:hover {
    background: #e4e4e4;
}

@bollwyvl
Copy link
Collaborator

background: #e4e4e4;

except not hardcoded...

@choldgraf
Copy link
Collaborator

choldgraf commented Mar 28, 2021

lol sorry that was my "minimal viable github issue product" 🙃

@jorisvandenbossche
Copy link
Member Author

What do you think about adding a lightweight UX to show when people are hovering over the arrow?

Is this something you would like to add to sphinx-book-theme as well? (I mimicked that look for now)
Note that there is actually already a hover color for the icon (but not the full label area), but because we currently use the dark purple for this, it's not very apparent.

Adding a more prominent area hover color might indeed be good. It's also what Furo does (although Furo also does that for the titles in the sidebar)

@jorisvandenbossche jorisvandenbossche marked this pull request as ready for review March 31, 2021 07:55
@jorisvandenbossche jorisvandenbossche changed the title Collapsible sections in the sidebar ✨ ENH: Collapsible sections in the sidebar Mar 31, 2021
@choldgraf
Copy link
Collaborator

I do think it's hard to see the arrow light up with any kind of dark color. I am 50/50 on importing it in the book theme, but it feels like a reasonable UX when I try it out myself on this theme:

50JDFrAt0r

@jorisvandenbossche
Copy link
Member Author

OK, I added a hover background color controlled by a new CSS variable.

@choldgraf
Copy link
Collaborator

@jorisvandenbossche
Copy link
Member Author

Woohoo, this will also be great to use in the pandas docs!

@ChaiByte
Copy link
Contributor

ChaiByte commented Apr 2, 2021

Coooooooooooool~!

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.

4 participants