pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
565 stars 304 forks source link

Article content is no longer centered when no sidebars are present #1691

Closed andykee closed 5 months ago

andykee commented 5 months ago

According to the docs, article_content should be centered when neither sidebar is present. This was the case prior to v0.15.* (screenshot below, built with v0.14.4):

Screenshot 2024-01-29 at 9 33 27 PM

This is no longer true as of v0.15.0rc0 - the content now seems to float left (screenshot below, same source as above rebuilt with v0.15.0rc0):

Screenshot 2024-01-29 at 9 34 26 PM

This behavior is still present in the latest release (v0.15.2)

Charlie-XIAO commented 5 months ago

Not sure but I think this may be the same problem as #1686? If you are removing the secondary sidebar my using secondary_sidebar_items as a dict in conf.py and setting the corresponding page to an empty list then I think it is the same issue. If you inspect the page I think you may find that the secondary sidebar div is still there, though empty.

andykee commented 5 months ago

It may be related, but is not identical to #1686. My conf.py doesn't define secondary_sidebar_items, although you are right that when I inspect the rendered page source, an empty div with class .bd-sidebar-secondary is there. Interestingly, on pages with a primary sidebar (.bd-sidebar-primary), the secondary sidebar isn't present.

Charlie-XIAO commented 5 months ago

Ah I see. So the reason is that secondary_sidebar_items is by default page-toc, edit-this-page, sourcelink if you just leave it as is, and that's why the secondary sidebar is showing up. Not the same cause as my issue, but I think #1688 is going to solve your problem as well. I may see if I can extend the tests in #1688 to cover your case. It would be nice if you can also try out the changes in #1688 to confirm if your issue gets resolved.

Interestingly, on pages with a primary sidebar (.bd-sidebar-primary), the secondary sidebar isn't present.

That's strange... I built your site locally, but .bd-sidebar-secondary exists regardless of the primary sidebar. For instance, it exists on the user guide page.

andykee commented 5 months ago

That's strange... I built your site locally, but .bd-sidebar-secondary exists regardless of the primary sidebar. For instance, it exists on the user guide page.

Apologies, I must not have dug down far enough into the source tree. You're right, .bd-sidebar-secondary always seems to be there...

I updated my original comment to reflect this.