I have wrapper with several items and would like to create fluid columns based on the space available, items that wrap to the second row should be hidden.
In the past I wrote something similar using flexbox and overflow: hidden with only one difference that the items had a fixed height.
In this case the items have a fluid height.
Is this behavior achievable with flexbox ?
Snippet serves as a visual representation of how my items behave
.wrapper {
display: flex;
flex-wrap: wrap;
gap: 1rem;
resize: horizontal;
overflow: auto;
}
.card {
flex: 1;
width: 100%;
min-width: 100px;
background: red;
padding: 3px;
}
<div class="wrapper">
<div class="card">Lipsum</div>
<div class="card">Longer descriptions</div>
<div class="card">Longer descriptions <br> foobar</div>
<div class="card">Small</div>
<div class="card">Foo</div>
<div class="card">Barr</div>
</div>