I have a simple layout with two rows. The top row should determine the width (based on its content, not a css value), and the two elements in the bottom row should expand to match that width:
---------------------------------
| row one is exactly this wide |
---------------------------------
| [...thing1...] [...thing2...] |
---------------------------------
<div.parent style='display: flex; flex-direction: column'>
<div.row1>row 1 is exactly this wide</div>
<div.row2 style='flex: 1; display: flex'>
<span style='flex: 1'>thing1</span>
<span style='flex: 1'>thing2</span>
</div>
</div>
The problem is that thing1 and thing2 expand up to their grandparent's width, not row1's:
----------------------------------------------------------------------
| row one is exactly this wide |
----------------------------------------------------------------------
| [..........thing1.............] [............thing2..............] |
----------------------------------------------------------------------
How can I constrain the parent div's width to be that of row1? Or, how do I achieve a layout like this?