I want to create a dynamic grid system that should behave like this: first when there is only 1 item it should have a width and height of 100%.
When the second child has been dynamically added to the grid it should have a height of 100% and the 2 items both 50% width.
When the THIRD item has been added the first 2 items should have a height 0f 50% and a width of 50%, the third item should have a height of 50% and a width of 100%.
Fourth item should then again have a width of 50% and height 50%.
fifth item again 100% width and all the items should have 33,33% height. No matter how many items are added the grid should always behave the same way.
Currently i have:
const StyledVideoContainer = styled.div`
${({ number }) => `
display: grid;
grid-template-columns: repeat(${number}, 1fr);
grid-template-rows: repeat(auto-fill, 100%);
.videoContent {
flex-grow: 1;
}
`}
`;
