In my grid layout, I have a maximum of 12 image cards per row. When there are 12 cards in a row, the size becomes quite small, so I want to show just the image. However, when there are only 6 cards in a row, I would like to display the description as well.
I attempted to use the d-none d-sm-block
utilities but they are defined by the viewport rather than considering the size of the card in the column.
<div class="d-flex flex-row flex-wrap">
<div class="col-md-4">
<div class="card mb-5 border-0">
<a class="link" href="{{pathFor 'thing.page' id=_id}}" >
<img src="{{getImage}}" class="card-img-top img-fluid" alt="">
</a>
<div class="card-body">
<p class="card-text">
text 1
</p>
<p class="card-text">
text 2
</p>
</div>
</div>
</div>
</div>
The value of col-md-4
is dynamically changed based on the number of columns set by the user.
My goal is for the card-text
to be hidden when there are 12 columns (smaller cards), but not if there are 5 columns!
Here is an image example:
and another one here: