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

Actual fullheight for heros #1949

Closed
dergoegge opened this issue Jun 18, 2018 · 17 comments · Fixed by #1954
Closed

Actual fullheight for heros #1949

dergoegge opened this issue Jun 18, 2018 · 17 comments · Fixed by #1954

Comments

@dergoegge
Copy link
Contributor

This is about Bulma.

It's a bug concerning the is-fullheight class.

It's not a browser bug.

Overview of the problem

This is about the Bulma CSS framework

I'm using Bulma version [0.7.1]
My browser is: Chrome, Opera

I am sure this issue is not a duplicate

Description

A fullheight hero is not fullheight if the navbar is fixed to the top.

Steps to Reproduce

  1. Add has-navbar-fixed-top to the class list of the html attribute.
  2. Set up a page as follows:
<section class='hero is-fullheight'>
    <div class="hero-body">
	  <div class="container">
	      <h1 class='title'>Title</h1>
	  </div>
      </div>
   <div class='hero-footer'>
	<div class="container">
	     <p>Not on the screen unless scrolled to</p>
	</div>
   </div>
</section >

Expected behavior

I expected to see the hero-footer on screen.

Actual behavior

The hero-footer will only be visible if scrolled to.

@jimblue
Copy link

jimblue commented Jun 20, 2018

Hi @dergoegge,

Here is my hack for this issue:

.hero.is-fullheight.has-fixed-navbar {
    min-height: calc(100vh - #{$navbar-height});
}

@dergoegge
Copy link
Contributor Author

dergoegge commented Jun 20, 2018

Not sure if this is actually a bug or intended behaviour...
But @jimblue 's hack works for me!

I will close the issue after some time if nobody else has something to say.

@jgthms
Copy link
Owner

jgthms commented Jun 20, 2018

This could be added as a modifier class.

@jimblue
Copy link

jimblue commented Jun 20, 2018

@jgthms that could be nice :)

@emkajeej
Copy link

wouldn't it be easier to use the body/html class, instead of adding another helper to the hero?
ie

.has-navbar-fixed-top .hero.is-fullheight {
    min-height: calc(100vh - #{$navbar-height});
}

@jimblue
Copy link

jimblue commented Jun 22, 2018

@emkajeej I think a modifier is better here. There's probably particularly cases where peoples would like to have the choice.

@emkajeej
Copy link

emkajeej commented Jun 25, 2018

I'm inclined to disagree. The docs state that a .is-fullheight modifier makes the hero as large as the viewport, so it's only fair that the user expects a component with the exact height of the viewport, not "the height plus a seemingly arbitrary amount of pixels".
Secondly, the .has-fixed-navbar naming implies that the navbar is part of the hero, while in reailty it's part of the body.

The same logic is also already being applied in navbar.sass:238.

In the edge case that the user actually wants the .is-fullheight hero to be slightly larger than the actual viewport the .has-navbar-fixed-top .hero.is-fullheight is easily overridden.

@frederikhors
Copy link

Can we have this (#1949 (comment)) code merged, @jgthms?

@tetreault
Copy link

tetreault commented Oct 4, 2018

+1 on this. fairly minimal page w/o any hero-head just a hero-body that has a centered div with minimal contents (height of only like 250px) and a hero-foot with 2 p tags in it (60px height) and I need to scroll to see the footer. expectation is that there's no scroll.

@jgthms
Copy link
Owner

jgthms commented Oct 4, 2018

The docs state that a .is-fullheight modifier makes the hero as large as the viewport, so it's only fair that the user expects a component with the exact height of the viewport, not "the height plus a seemingly arbitrary amount of pixels".

That's not true. The fullheight hero is basically never higher than the viewport. The height is set with min-height: 100vh. I'm using min-height and not height because I don't want the content to be clipped if it's higher than the viewport. But that's almost never the case, and not the case here.

Example: https://codepen.io/jgthms/pen/ReRPpe

The hero is fullheight here. You can't see the footer because the has-navbar-fixed-top class on the <html> adds padding at the top. But you can see that the hero is fullheight (I made the navbar transparent). So:

  • has-navbar-fixed-top is doing what's it's supposed to
  • is-fullheight is doing what's it's supposed to

It would be disingenuous to make the is-fullheight class make the hero less than fullheight.

The solution is with an additional modifier for the hero, something like the one stated here: #1949 (comment)

@dergoegge
Copy link
Contributor Author

@jgthms The PR #1954 i opened does not change the is-fullheight class. It adds another modifier to the hero like you proposed early on. Maybe take a look and merge or give me a few pointers as to what more needs to be done so we can get this issue resolved!

@jgthms
Copy link
Owner

jgthms commented Oct 4, 2018

Thanks @dergoegge that's pretty good actually! Will have a proper look later.

@emkajeej
Copy link

emkajeej commented Oct 8, 2018

The solution is with an additional modifier for the hero, something like the one stated here: #1949 (comment)

In the above solution the hero height is also being modified to be less than the viewport.
i'm proposing exactly that, but with the modifier being on the body rather than the hero for the reasons stated in the second half of my comment (ie semantically and for consistency).

@claide
Copy link

claide commented Aug 30, 2019

Encountered a weird behavior using is-fullheight-with-navbar to the hero element.
Everything works but when adding the same hero to another page, the hero element is residing behind the navbar fixed top.

@i-defranca
Copy link

Encountered a weird behavior using is-fullheight-with-navbar to the hero element.
Everything works but when adding the same hero to another page, the hero element is residing behind the navbar fixed top.

@claide I'm having this problem too. Did you find a solution?

@claide
Copy link

claide commented Dec 3, 2019

Encountered a weird behavior using is-fullheight-with-navbar to the hero element.
Everything works but when adding the same hero to another page, the hero element is residing behind the navbar fixed top.

@claide I'm having this problem too. Did you find a solution?

Hmm I forgot about this, but try to add class has-navbar-fixed-top to your html tag like below

<html class="has-navbar-fixed-top">

@ompande
Copy link

ompande commented Jul 18, 2020

This is about Bulma.

It's a bug concerning the is-fullheight class.

It's not a browser bug.

Overview of the problem

This is about the Bulma CSS framework

I'm using Bulma version [0.7.1]
My browser is: Chrome, Opera

I am sure this issue is not a duplicate

Description

A fullheight hero is not fullheight if the navbar is fixed to the top.

Steps to Reproduce

  1. Add has-navbar-fixed-top to the class list of the html attribute.
  2. Set up a page as follows:
<section class='hero is-fullheight'>
    <div class="hero-body">
	  <div class="container">
	      <h1 class='title'>Title</h1>
	  </div>
      </div>
   <div class='hero-footer'>
	<div class="container">
	     <p>Not on the screen unless scrolled to</p>
	</div>
   </div>
</section >

Expected behavior

I expected to see the hero-footer on screen.

Actual behavior

The hero-footer will only be visible if scrolled to.

Thanks! It worked.

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 a pull request may close this issue.

9 participants