title: Safari: flexbox and min-height
body: <p>I need to have a scrolling flexbox container with flexbox children. The container has a (by flexbox) defined height, the children should be just as high as their content.</p>
  
  <p>This works well except in Safari, where the children won't stretch beyond the container's height. Actually, the behavior in Safari is exactly the same as if the children had <code>min-height: 0</code>, but they don't. Explicitly setting <code>min-height: auto</code> doesn't help.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>div {
    background-color: rgba(0,0,0,.1);
    box-sizing: border-box;
    margin: 4px;
    padding: 4px;
  }
  
  .fixed {
    height: 100%;
    left: 0;
    max-height: 400px;
    position: fixed;
    top: 0;
    width: 100%;
  }
  
  .flex {
    display: flex;
    flex-direction: column;
    /* Safari behaves like min-height: 0; */
  }
  
  .full {
    flex: 1;
    overflow-y: auto;
  }
  
  .big {
    font-size: 200px;
    line-height: 1;
    margin: 0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="fixed"&gt;
    &lt;div class="flex" style="height: 100%"&gt;
      &lt;div&gt;
        A
      &lt;/div&gt;
      &lt;div class="flex full"&gt;
        &lt;div class="flex"&gt;
          B_1
        &lt;/div&gt;
        &lt;div class="flex"&gt;
          &lt;p class="big"&gt;B_2&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="flex"&gt;
          &lt;p class="big"&gt;B_3&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div&gt;
        C
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I couldn't find any recent flexbox bugs documented for Safari, but for me this looks like one. I encountered this in Safari 13 on MacOS (Catalina) and in Safari and Chrome on iOS 12.</p>
  
  <p>Is their an CSS-only way to fix or work around this?</p>