The component I must implement looks like the tile groups on Metro :
- the width of the horizontal flow of groups depends of the number of groups
- each group contains a title, its width must be extended to the group content
- each group contains an undetermined number of tiles arranged by columns
I nearly reach the goal, but I don't get why the flex container extends itself. Is there a way to shrink its width to its own content width (remove the blue space on the right of cyan tiles)
DEMO :
CSS :
div.vertical {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-self:flex-start;
align-items: flex-start;
background-color:blue;
max-height:100%;
}
HTML :
<div class="vertical">
<div class = "vertical-tile">
1
</div>
<div class = "vertical-tile">
2
</div>
<div class = "vertical-tile">
3
</div>
</div>
if you think it's not the good approach, what's your proposal to resolve this issue?