title: Flex items expanding to content height
body: <p>I am using flexbox layout to position three divs in a column so that each div has the same height. Each div displays a scrollbar if its content is too large. I would like each section to only expand to the height of its content, but currently what happens is that every section is always the same height regardless of the content in it.</p>
  
  <p>If the container is 900px, each section should be 300px, and if the content of a section is more than 300px tall, a scroll bar should appear. However, if the content of lets say the middle section is only 100px tall, that section should only be 100px, and the remaining sections should fill in the remaining space, so they would each be 400px tall.</p>
  
  <p>Example: <a href="http://jsfiddle.net/x6puccbh/2/" rel="nofollow">http://jsfiddle.net/x6puccbh/2/</a></p>
  
  <p>As you can see in this example, the middle section is the same height as the other sections, but I would like it to only be as tall as its content. Is this possible using flex layout?</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;div class="panel"&gt;
          &lt;div class="section"&gt;
              &lt;div class="header"&gt;HEADER&lt;/div&gt;
              &lt;div class="content"&gt;content&lt;br&gt;content&lt;br&gt;content&lt;br&gt;content
                  &lt;br&gt;content&lt;br&gt;content&lt;br&gt;content&lt;br&gt;content
                  &lt;br&gt;content&lt;br&gt;content&lt;br&gt;content&lt;br&gt;content&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="section"&gt;
              &lt;div class="header"&gt;HEADER&lt;/div&gt;
              &lt;div class="content"&gt;content&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="section"&gt;
              &lt;div class="header"&gt;HEADER&lt;/div&gt;
              &lt;div class="content"&gt;content&lt;br&gt;content&lt;br&gt;content&lt;br&gt;content
                  &lt;br&gt;content&lt;br&gt;content&lt;br&gt;content&lt;br&gt;content
                  &lt;br&gt;content&lt;br&gt;content&lt;br&gt;content&lt;br&gt;content
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
   &lt;/div&gt;
  
  .container {
      height: 300px;
  }
  
  .panel {
      display:flex;
      flex-direction: column;
      height: 100%;
  }
  
  .header {
      height: 15px;
      text-align: center;
      flex-shrink: 0;
  }
  
  .section {
      flex-grow: 1;
      flex-shrink: 1;
      flex-basis: auto;
      height: 100%;
      border: 1px solid red;
      display: flex;
      flex-direction: column;
  }
  
  .content {
      overflow-y: auto;
      height: 100%;
  }
  </code></pre>