I have a challenging task at work - which requires a pure CSS solution
I receive an array of widgets that are either 33% width or 66% width in size. They need to be ordered in the order they are received but the total width of widgets cannot exceed 100%.
The screenshot below depicts the order in which the items should fill the screen but the numbers indicate the order in which they were received. Note that item 3 is too big to fit in after item 2 so item 4 (which is lower in priority) fills up the empty space at the top
How do I do it with flex? I get the components list when the page is loading.