I'd like to create a grid system using only flexbox.
It seems to not be working when the children have no content.
As you can see below, the last child in the last row doesn't align.
.flexline {
display: flex;
}
.flexline.is-full>* {
flex-grow: 1;
}
.flexline.is-full>.is-taking-2 {
flex-grow: 2;
}
/* color */
.flexline {
background-color: rgba(255, 0, 0, 0.12);
height: 60px;
}
.flexline>* {
background-color: rgba(0, 128, 0, 0.33);
margin: 5px;
}
/* /color */
<div class="flexline is-full">
<div>x</div>
<div></div>
<div>x</div>
</div>
<div class="flexline is-full">
<div>x</div>
<div class="is-taking-2"></div>
</div>