Skip to content

Fix the max-width wrapping #128

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 3 commits into from
Mar 17, 2020
Merged

Conversation

choldgraf
Copy link
Collaborator

@choldgraf choldgraf commented Mar 16, 2020

Fixes #118

I think that this should fix the weird width issues, and while I'm at it I also made the content center properly, I think.

For some reason, I think that the .bd-content {max-width: rule was messing up our max widths and this was causing large content blocks to expand the width of the main block in the middle. This removes that, and we can control the max width of things at the .container level rather than within the container (since we should be using the bootstrap CSS classes for that).

It also adds a container wrapper around the navbar so that we can center it exactly as our content is centered

Check out this page in the docs, which used to break the sidebar and cause weirdly-wide content in the middle: https://186-130237506-gh.circle-artifacts.com/0/html/demo/lists_tables.html

@choldgraf choldgraf force-pushed the cssfix branch 2 times, most recently from 8377ecd to 98b2814 Compare March 16, 2020 16:52
@jorisvandenbossche
Copy link
Member

cc @hoetmaaiers

@@ -207,7 +211,7 @@ td:first-child {

.navbar-light {
background: #fff !important;
box-shadow: 0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.11);
box-shadow: 0 0.125rem 0.25rem -0.125rem rgba(0, 0, 0, 0.11);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes the drop-shadow on the navbar point straight down

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the shadow less prominent, that is on purpose? (no strong opinion)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the intention, it was actually only necessary due to the centering (so that the top-bar didn't have shadows to the right and left, as they do now)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about I just strip away everything except for removing the max-width of .bd-content? I feel like that is an important bugfix that's getting bogged down by these other design questions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about I just strip away everything except for removing the max-width of .bd-content? I feel like that is an important bugfix that's getting bogged down by these other design questions

Yep, +1

@@ -225,10 +229,6 @@ td:first-child {
padding: 0 15px;
}

.bd-content {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is what was throwing off the width stuff

</nav>

<div class="container-fluid">
<div class="row flex-xl-nowrap">
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was redundant, and changing it didn't seem to alter any behavior

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@choldgraf thanks a lot for looking at this!

I played a bit with the demo docs, and the issues indeed seem to be resolved with this.

I am only not fully sure about the centering included in this PR. To be clear, I think this is an improvement, but if we are going to further tweak it some more (cfr #17), I might want to get the max-width fix merged in separately (so I can use it for the pandas docs, we might do a 1.0.3 bug fix, so would be nice to also fix the docs by then).

@choldgraf
Copy link
Collaborator Author

@jorisvandenbossche that works for me - I'll remove the centering stuff and keep this at fixing the width issues

@jorisvandenbossche
Copy link
Member

This needs a rebase/merge now I merged the other PR

@choldgraf
Copy link
Collaborator Author

ok, should be rebased...double check that it looks good!

.container-fluid {
max-width: 1300px;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one can still be kept? (to preserve the max-width introduced earlier)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on wide screens, that will center the content in the middle, with the top navbar spanning the full width:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, should there be some left alignment added then (until the centering is done)?

If that gets too complicated, fine with reverting to full width for now (since the wrapping bug is annoying enough)

Copy link
Collaborator Author

@choldgraf choldgraf Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can manually remove the left margin by over-riding the bootstrap CSS, though I feel like that's a not-good practice we have learned the hard way already 😆 ...let me know what you want me to do (would prefer to figure out before I tweak things, because it is now a huge pain in the butt to edit the CSS since I have to wait for 25 seconds each time)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@choldgraf how come you have to wait for 25 seconds each time? Are you using the webpack buid:dev flow?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yikes, I just read #127. I will look into this today!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's then revert the max-width here. At least that fixes the main bug, and then @hoetmaaiers can work on a better solution

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what you mean? Do you want max-width or not? Sorry, just can't tell from the language :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant "revert" as revert the max-width that is in master, so keeping the revert (removing the max-width) you already did here (and thus not "revert your revert" ;-))

@jorisvandenbossche jorisvandenbossche changed the title fixing width and centering Fix the max-width wrapping Mar 16, 2020
@choldgraf
Copy link
Collaborator Author

@jorisvandenbossche the latest commit reverts any changes other than the bugfix. I added in a comment mentioning what to do about the box shadow if we want it to point down.

@jorisvandenbossche jorisvandenbossche merged commit a071ab7 into pydata:master Mar 17, 2020
@jorisvandenbossche
Copy link
Member

Thanks Chris!

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.

Max-width broken with wide elements + for certain widths
3 participants