css flexbox gap
Hey everyone, is there a way to make the gap diminish to 0 while resizing a nav bar before the navbar overflows (assuming the nav bar items have a min-inline-size so they can't shrink)
3 Replies
currently, my gap won't shrink, when I resize, once it reaches the min-inline-size of the nav items, it will overflow, which makes sense but I am wondering if there is a way to make the gap shrink from 1rem to 0 before it overflows
you can use a clamp on the gap, something like
gap: clamp(0rem, 1vw, 1rem)
. it won't go to 0 fully, but you can try and play a bit with the values for your use case;thank you MarkBoots, that's what I ended up doing. I ended up on utopia.fyi and used their spacing generator and came up with a clamp that worked