Skip to content
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

Issue with flexbox flex-grow #223

Open
aegatlin opened this issue May 20, 2020 · 0 comments
Open

Issue with flexbox flex-grow #223

aegatlin opened this issue May 20, 2020 · 0 comments

Comments

@aegatlin
Copy link

This could be related to #222 , but it felt different enough so I'll post it here.

We are building a Phoenix LiveView app and we have the following CSS:

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {}
footer {}
main {
  flex-grow: 1;
}

The goal is to give main a min-height of "whatever the rest of the viewport height is". However, this causes a flicker effect on page load because a div with id="nprogress" is added to the bottom of the page. This has an effect on the "remaining height" that was otherwise being allocated to main. The div is almost immediately removed, after which the page returns to normal.

I have fixed the issue with the following CSS:

#nprogress {
  max-height: 0;
}

It still shows the progress bar on the top, so it seems to be a perfect fix, since I still get the progress bar, but now don't have to deal with the flicker effect it caused.

This could be a possibly small fix to introduce for people that have display: flex on their body element, and are doing so for a reason similar to mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant