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

The grid add an additional size to the last element #3783

Open
zkmark opened this issue Apr 11, 2024 · 2 comments
Open

The grid add an additional size to the last element #3783

zkmark opened this issue Apr 11, 2024 · 2 comments

Comments

@zkmark
Copy link

zkmark commented Apr 11, 2024

This is about Bulma.
It's a bug or design issue/discussion.

Overview of the problem

This is about the Bulma CSS framework

I'm using Bulma version 1.0.0
My browser is: Chrome

I am sure this issue is not a duplicate? Yes

Description

When I use cards with cell inside the grid, the last card has an extra size, and they should all have the same height

Steps to Reproduce

Codepen Example
https://codepen.io/zkmark/pen/JjVZoNB

Code example

<section class="section">
	<div class="container">

		<div class="fixed-grid has-4-cols">
			<div class="grid is-gap-3">

				<article class="cell card">
				  <div class="card-image">
				    <figure class="image is-4by3">
				      <img
				        src="https://bulma.io/assets/images/placeholders/1280x960.png"
				        alt="Placeholder image"
				      />
				    </figure>
				  </div>
				  <div class="card-content">
				    <div class="media">
				      <div class="media-left">
				        <figure class="image is-48x48">
				          <img
				            src="https://bulma.io/assets/images/placeholders/96x96.png"
				            alt="Placeholder image"
				          />
				        </figure>
				      </div>
				      <div class="media-content">
				        <p class="title is-4">John Smith</p>
				        <p class="subtitle is-6">@johnsmith</p>
				      </div>
				    </div>

				    <div class="content">
				      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec
				      iaculis mauris. <a>@bulmaio</a>. <a href="#">#css</a>
				      <a href="#">#responsive</a>
				      <br />
				      <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time>
				    </div>
				  </div>
				</article>

				<article class="cell card">
				  <div class="card-image">
				    <figure class="image is-4by3">
				      <img
				        src="https://bulma.io/assets/images/placeholders/1280x960.png"
				        alt="Placeholder image"
				      />
				    </figure>
				  </div>
				  <div class="card-content">
				    <div class="media">
				      <div class="media-left">
				        <figure class="image is-48x48">
				          <img
				            src="https://bulma.io/assets/images/placeholders/96x96.png"
				            alt="Placeholder image"
				          />
				        </figure>
				      </div>
				      <div class="media-content">
				        <p class="title is-4">John Smith</p>
				        <p class="subtitle is-6">@johnsmith</p>
				      </div>
				    </div>

				    <div class="content">
				      Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet,Lorem ipsum dolor sit amet,Lorem ipsum dolor sit amet,consectetur adipiscing elit. Phasellus nec
				      iaculis mauris. <a>@bulmaio</a>. <a href="#">#css</a>
				      <a href="#">#responsive</a>
				      <br />
				      <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time>
				    </div>
				  </div>
				</article>

				<article class="cell card">
				  <div class="card-image">
				    <figure class="image is-4by3">
				      <img
				        src="https://bulma.io/assets/images/placeholders/1280x960.png"
				        alt="Placeholder image"
				      />
				    </figure>
				  </div>
				  <div class="card-content">
				    <div class="media">
				      <div class="media-left">
				        <figure class="image is-48x48">
				          <img
				            src="https://bulma.io/assets/images/placeholders/96x96.png"
				            alt="Placeholder image"
				          />
				        </figure>
				      </div>
				      <div class="media-content">
				        <p class="title is-4">John Smith</p>
				        <p class="subtitle is-6">@johnsmith</p>
				      </div>
				    </div>

				    <div class="content">
				      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec
				      iaculis mauris. <a>@bulmaio</a>. <a href="#">#css</a>
				      <a href="#">#responsive</a>
				      <br />
				      <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time>
				    </div>
				  </div>
				</article>

				<article class="cell card">
				  <div class="card-image">
				    <figure class="image is-4by3">
				      <img
				        src="https://bulma.io/assets/images/placeholders/1280x960.png"
				        alt="Placeholder image"
				      />
				    </figure>
				  </div>
				  <div class="card-content">
				    <div class="media">
				      <div class="media-left">
				        <figure class="image is-48x48">
				          <img
				            src="https://bulma.io/assets/images/placeholders/96x96.png"
				            alt="Placeholder image"
				          />
				        </figure>
				      </div>
				      <div class="media-content">
				        <p class="title is-4">John Smith</p>
				        <p class="subtitle is-6">@johnsmith</p>
				      </div>
				    </div>

				    <div class="content">
				      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec
				      iaculis mauris. <a>@bulmaio</a>. <a href="#">#css</a>
				      <a href="#">#responsive</a>
				      <br />
				      <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time>
				    </div>
				  </div>
				</article>
  		</div>
		</div>
		
	</div>
</section>

Expected behavior

All cards should have the same height within the grid

Actual behavior

The last card has a larger height

@JimCook57
Copy link

JimCook57 commented Apr 17, 2024

Also has this problem when using grid with cell box classes.

<div class="grid">
<div class="cell box">
Normal Size
</div>
<div class="cell box">
Normal Size
</div>
<div class="cell box">
Extra row in box
</div>
</div>

Screenshot 2024-04-16 at 11 40 02 PM

@jpretak
Copy link

jpretak commented May 10, 2024

Look into this style declaration:
.card:not(:last-child){ margin-bottom: var(--bulma-block-spacing); }

So every card except that last one has a bottom margin within the grid (or whatever block element) so they are being shortened, not the other way around.

You can fix this by adding the following line of css:

.grid .card:last-child{
margin-bottom: var(--bulma-block-spacing);
}

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

No branches or pull requests

3 participants