-
Notifications
You must be signed in to change notification settings - Fork 341
ENH: max-width layout for wide screens #134
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: max-width layout for wide screens #134
Conversation
…x-theme into feature/max-width
This looks nice! Didn't look at any code, just the rendered docs (https://212-130237506-gh.circle-artifacts.com/0/html/demo/example_pandas.html), and some quick first comments:
For example, in the screenshot above, I would say that if there is more space, the left TOC can also use more space. I agree that if horizontal screen space is limited, the TOC sidebar is the first thing that can be limited / removed, but it would be nice to still allow it to be bigger if possible. |
+1 on removing the "home" link (actually, I think that we should optionally have a site title instead of a logo, and have that link to "index", and remove the home page) the CSS/layout looks quite nice! I'm a little bit confused about the amount of code files changed - when I was playing around with centering the content, all it took was wrapping the top |
Yes, also +1 on removing the Home link and having the logo for this (although that can maybe done in a separate PR?). And being able to use text instead of a logo also sounds good as an option. I also verified in the demo docs that the buggy behaviour we ran into before (#118) doesn't happen with this PR for me. |
Ok, thank you all for the feedback. I will continue my work on this and ensure the content should grow wider on a wider viewport. Also a fix for 'giant' content is in the making, well spotted @stijnvanhoey . For now I am opting for an inline scroll solution. Tables can be made responsive, but this is not straightforward. Good question from you @choldgraf, the basic implementation would indeed be what you described. I took it a little further into detail, so this PR zooms in into some details to look more like the mockup. Also some refactoring of the css is included (I will continue this some further). Thanks @jorisvandenbossche for testing #118. To be continued... |
Sounds good! Small general point of feedback: to the extent possible, try to prefer smaller PRs / break certain aspects that can be done independently into its own PR. Although initially a bit more work for you (to split it up, to update branches if something else is merged ..), it will also speed up reviewing and thus allow that some things already get merged faster. To the extent that it doesn't make working on it too cumbersome of course! (because I assume that part of the reason for the big diff that @choldgraf asked about is also because there are some (useful!) changes not strictly related to the max-width setting) |
agreed - for example, I quite like the new searchbar CSS that I noticed you added :-) |
min-width 1500px
Good remark on keeping PR's smaller. I already tried to focus but extra's creeped in. An extra breakpoint for larger screens is added. At min width of 1500px, the container is spread out to 1400px. Which allows the body container to be 750px (excl. white space) which is still good for readability. The bd-content allows elements wider then the bd-content container to overflow via scroll. This might be solved more elegantly. I miss the indication that content is hidden behind scroll, maybe a visual indicator (shadow) could solve this? Home nav item removed. |
86748bd
to
e7a0732
Compare
Some extra insight for this choice... I had the same idea and made the brand-logo and sidebar 2 columns wide. But then the body content became too wide (in my opinion). The idea of a max-width is to improve readability of the main content. Also having lots of top-level toc items still have space issues on a smaller viewport. |
couldn't the top bar have widths independent of the content beneath it? |
hmmm, I like the symmetry as well - but maybe this can be breakpoint-controlled? Either way, I don't think that it should block this PR...we can always see if other folks complain about the lack of width. |
Something that I noticed about this, eg on the "Lists & Tables" demo page (https://220-130237506-gh.circle-artifacts.com/0/html/demo/lists_tables.html#giant-tables), the tables now are "scrollable" (they are no longer put on top of the sidebar), but the scrollbar is not inline at the table, but only at the bottom of the full page:
Yes, I think we can look into different options (or ways to customize this for users) in a follow-up. |
@hoetmaaiers and thanks for the updates! The default width on my screen for the content looks better now. I have some more comments about the widths of the different columns. But not all have necessarily to be handled in this PR. And also, I am just looking at it as a user of the docs, and some of the things I am asking might not be at all straightforward, no idea! 1. I still find the width of the TOC a bit small. Consider the follow screenshot. The first title of the TOC (which is in bold), "Different choices for indexing", is now wrapped on two lines. While there is plenty of empty space to the right
|
One more thing that I noticed on the smartphone mode: Master (https://pydata-sphinx-theme.readthedocs.io/en/latest/): versus this PR -> the logo is smaller (I suppose something with the allowed height changed) Now, this might also be due to the pandas logo, as I noticed elsewhere that it has a lot of whitespace around it in the logo file itself, which makes it more difficult to let look larger in general. |
font-size: 1.44em; | ||
} | ||
// include core Bootstrap | ||
@import '../../node_modules/bootstrap/scss/bootstrap'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This includes all of bootstrap css in our index.css, right?
I don't know if this is best to solve #89, but a downside of this is that on the actual site, this makes it difficult to see which parts of css is coming from main bootstrap, and which are customizations from this theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just bundle bootstrap, minified, in this theme, and directly link it? I'd be +1 on that, I actually need to do this in a downstream theme anyway in order to get PDF printing to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, this includes all of bootstrap in our index.css. Bundling bootstrap as in this theme would make us lose the configuration options Bootstrap provides.
A solution to might satisfy both would be to have 2 css outputs defined in Webpack.
- Full bootstrap with custom configuration applied.
- Custom css applied after bootstrap.
Would this be a solution for @jorisvandenbossche and @choldgraf cases?
This should be a different PR, since it might be more complicated then it seems. Especially in combination with #139 to allow bootstrap Mixins to be available in the custom css without bundling twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually found a workaround on my end that didn't require bundling bootstrap, though I think there's still a benefit to this for working in an offline context. Depending on how complex it makes things I am interested!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that at least sounds an interesting option to explore, to see if that would be possible to have two css outputs.
But indeed fine to do as a follow-up
@jorisvandenbossche re: your comment about overflows etc, doing #131 seemed to fix it for me (particularly the "overflow" bootstrap classes) |
Ok, most issues are fixed in this PR. A summary:
Things I would move into separate PRs:
|
44917ba
to
6afa2c1
Compare
.bd-sidebar { | ||
.bd-sidebar { | ||
padding-top: 1em; | ||
@media (min-width: 768px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is another example that could be a breakpoint include
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
I think it looks nice 👍 I'd be +1 on merging this as a clear improvement, and then spot-checking things in the future |
OK, sounds good, let's merge this now, and handle remaining feedback in follow-up PRs. Thanks @hoetmaaiers ! |
This PR adds a max-width layout as discussed in #17.
I would like a first round of feedback before continuing on extra related work: