title: How to make a flex element fully expand to fill the containing element?
body: <p>Here is my code. </p>
  
  <p>I want the element <code>.container</code> to fully expand and occupy the area of <code>.toplevel</code>. 
  <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>.toplevel {
    height: 100%;
    min-height: 800px;
    border: solid 1px blue;
  }
  
  .container {
    display: flex;
    border: solid 1px red;
    height: 100%;
    flex: 0 1 auto;
    flex-direction: column;
    // min-height: 800px;
  }
  
  .up {
    display: flex;
    flex: 1 1 auto;
  }
  
  .down {
    display: flex;
    flex: 0 1 auto;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="toplevel"&gt;
    &lt;div class="container"&gt;
      &lt;div class="up"&gt;
        This is up
      &lt;/div&gt;
      &lt;div class="up"&gt;
        This is down
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>However it seems like the only way to make the <code>.container</code> larger height-wise is to define a <code>min-height</code>. It is too inflexible because I will have provide a different value for different device form factor.</p>
  
  <p>How can I fix it? </p>