executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
429 stars 198 forks source link

No right sidebar page width #736

Closed adamgayoso closed 10 months ago

adamgayoso commented 1 year ago

Describe the bug

When there is no header for a right sidebar, the width of the main content collapses

https://docs.scvi-tools.org/en/latest/api/index.html

Screenshot 2023-05-25 at 9 29 13 AM

Reproduce the bug

Have a simple page with only a top-level heading.

List your environment

No response

sneakers-the-rat commented 1 year ago

Adding to this - the fix seems simple enough.

The problem seems to come from the bd-content container not having its flex-direction set. The default is row so the footer is positioned to the right of the page content rather than beneath it

(eg https://jupyterbook.org/en/stable/content/citations.html )

Screen Shot 2023-06-26 at 1 03 44 PM

If you instead manually set flex-direction: column then the page is laid out as expected:

Screen Shot 2023-06-26 at 1 05 32 PM

It seems like this is a pydata-sphinx-theme problem though, specifically the column mode would need to go here: https://github.com/pydata/pydata-sphinx-theme/blob/bc82874fe6b966cc8700f32fb38d2f6a536d22ae/src/pydata_sphinx_theme/assets/styles/sections/_article.scss#L10

But I don't know enough about this theme, that theme, and how they interact to know if that would be something that should go there or here.

The PR seems trivial, just one changed CSS value, so I can make that either here or there depending on what maintainers think would be better, but ya would be nice to fix bc i'm just doing this downstream atm

flying-sheep commented 1 year ago

@sneakers-the-rat nope, what you see is #742. The next/prev footer isn’t supposed to be a direct child of .bd-content

The actual problem is this hack:

https://github.com/executablebooks/sphinx-book-theme/blob/a9794b73cec766e01bee35a96f7d44e22851f278/src/sphinx_book_theme/assets/styles/sections/_article.scss#L1-L3