I am creating a grid layout with cards where not all the cards have the same height. Now I want the gap in between the cards be the same, event when the height of the cards is different. It would be somewhat of a mosaic layout.
I am using Styled Components. This is what I have so far, but it doesn't seem to work.
export const Wrapper = styled.div`
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 30px;
grid-auto-rows: minmax(0, 1fr);
`;
export const Card = styled.div`
background: #ffffff;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25);
border-radius: 4px;
padding: 30px;
display: flex;
flex-direction: column;
gap: 15px;
justify-content: space-between;
height: fit-content;
`;
How would I get it so that the gap in between the rows would be the same, even without the consistent card height?