I wonder if anyone could give me a simple intro about how flexbox layout gets calculated, especially in which priority order, for example:
<div id="container" style="display: flex; flex-direction: row; flex-wrap:wrap;">
<div style="flex: 1 0 200px; height:200px; background-color: lightgreen;"></div>
<div style="flex: 1 1 400px; height:200px; background-color: lightyellow;"></div>
<div style="flex: 1 0 200px; height:200px; background-color: lightblue;"></div>
</div>
I find it interesting that if I make the container width smaller than 600px; the wrap will take effect first before the shrinking (I set the second yellow block to flex: 1 1 400px;
) which turn into 3 rows, then the shrinking take effect until container reach 200px;
I wonder what is the order/rule the flexbox layout get decided? Why it does not just shrink from 400 block?
And even I also set all three blocks to flex: 1 1 their basis size;
the wrap still happens first.
Thanks