Skip to content

Improvements to LH sidebar layout #97

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

Merged
merged 4 commits into from
Mar 22, 2025
Merged

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Mar 21, 2025

This improves the layout of the donate button by stretching it to fill the full width of the sidebar. In order to test this I've also added the current donate button sidebar from https://github.com/matplotlib/matplotlib. This adds a dependency of sphinx-design here. I've done this in the spirit of keeping all the code for the donate button in mpl-sphinx-theme, so it can be used by other projects, not just the main Matplotlib docs.

In conjunction with matplotlib/matplotlib#29789, this improves the layout:

Before:
Screenshot 2025-03-21 at 11 48 01

After:

Screenshot 2025-03-21 at 12 50 14

@dstansby dstansby marked this pull request as draft March 21, 2025 12:32
@timhoffm
Copy link
Member

Can we keep a larger margin between the cheetsheet and the support button? They are not related and thus should be cleary separated.

@dstansby dstansby marked this pull request as ready for review March 21, 2025 12:51
@dstansby
Copy link
Member Author

Can we keep a larger margin between the cheetsheet and the support button? They are not related and thus should be cleary separated.

👍 - I realised that the cheatsheet sidebar is specific to the main Matplotlib docs, so I made this change (and other cheatsheet changes) at matplotlib/matplotlib#29789

@jklymak
Copy link
Member

jklymak commented Mar 21, 2025

It would be preferable if the left hand gutter didn't grow relative to the main content

@dstansby
Copy link
Member Author

dstansby commented Mar 21, 2025

It would be preferable if the left hand gutter didn't grow relative to the main content

Do you mean the LH sidebar changing width when the browser window is resized? Looking at the CSS I think that's baked into pydata-sphinx-theme, so would be a request to change upstream, and I think out of scope of this PR anyway (which deals with how our content fits inside the sidebar, not the sidebar itself).

@jklymak
Copy link
Member

jklymak commented Mar 21, 2025

Your two screen shots make it seem the LHS sidebar has gotten wider. Perhaps you just changed the width of your browser window?

@dstansby
Copy link
Member Author

dstansby commented Mar 21, 2025

Ah that's just because the 'after' screenshot is cropped off a bit on the right (you can see the twitter icon is cropped out). In browser/real life they're the same width.

@jklymak jklymak merged commit 3d40411 into matplotlib:main Mar 22, 2025
3 checks passed
@dstansby dstansby deleted the lh-sidebar branch March 22, 2025 18:34
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.

3 participants