Uh oh!
There was an error while loading. Please reload this page.
Make sidebar width more flexible - #218
Conversation
AA-Turner
commented
Feb 2, 2025
Could we do a percentage width of say 25% (so 256px at the lower bound before the sidebar disappears)? |
tomasr8
commented
Feb 2, 2025
Just to clarify, you mean to have a fixed sidebar width of 256px or some kind of dynamic sizing? The latter would require additional style changes |
AA-Turner
commented
Feb 2, 2025
A width defined in % or vw units, yes. |
tomasr8
commented
Feb 2, 2025
We might need some more breakpoints for that - |
hugovk
commented
Feb 2, 2025
And maybe an upper bound where it's a fixed width, compare: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/index.html As it stands, this is PR good for mobile, the sidebar is always shown: |
tomasr8
commented
Feb 3, 2025
I made the sidebar more like the pydata theme Hugo shared. The width is now calculated as
Fixed, some of the selectors I was using were too specific. |
| } | ||
| div.sphinxsidebar { | ||
| display: flex; |
There was a problem hiding this comment.
This allows me to remove the hardcoded width: 217px; from div.sphinxsidebarwrapper
hugovk
commented
Feb 3, 2025
(There's a conflict after merging #219.) |
tomasr8
commented
Feb 3, 2025
Will fix it in a bit |
hugovk
commented
Feb 4, 2025
Thanks! |
tomasr8
commented
Feb 4, 2025
Thanks for the reviews/comments! |

Related issue: #209
This is a less disruptive version of #214
This simply increases the width of the sidebar to 260px (not set in stone, happy to discuss the appropriate value)
Two more things I considered that we could discuss but didn't include in the PR
.bodywrapper). Though we could convert it to flexbox as well.Feedback welcome!
📚 Documentation preview 📚: https://python-docs-theme-previews--218.org.readthedocs.build/