I am currently working on a grid layout featuring cards of varying heights. My goal is to maintain a consistent gap between the cards, creating a mosaic-like design. I am utilizing Styled Components for this project, but the current code I have doesn't seem to achieve the desired result.
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;
`;
I am seeking a solution to ensure that the gap between rows remains uniform, even when the card heights are not consistent.