title: How to make a specific row's height auto depending on it's content with css grid?
body: <p>I have a page layout that works exactly the way I want it... But for another page, I have some content and want to automatically adjust the height of the row they are in. For example I want to expand it like that;</p>
  <p><img src="https://i.stack.imgur.com/KaTAH.jpg" alt="example image" /></p>
  <p>I want to expand the &quot;left2&quot; height depending on the &quot;right2&quot; height. But don't want to change the &quot;left1&quot;, &quot;right1&quot; and &quot;footer&quot; heights...</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>.project-container {
    display: grid;
    height: 100vh;
    grid-template-columns: 4fr 3fr;
    grid-template-rows: 7fr 4fr 2fr;
    grid-template-areas:
      "left1 right1"
      "left2 right2"
      "footer right2";
  }
  
  .left1 {
    grid-area: left1;
    background-color: red;
  }
  .left2 {
    grid-area: left2;
    background-color: blue;
  }
  .footer {
    grid-area: footer;
    background-color: purple;
  }
  .right1 {
    grid-area: right1;
    background-color: green;
  }
  .right2 {
    grid-area: right2;
    background-color: orange;
    font-size: 2vw;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="project-container"&gt;
      &lt;div class="left1"&gt;&lt;/div&gt;
      &lt;div class="left2"&gt;&lt;/div&gt;
      &lt;div class="footer"&gt;&lt;/div&gt;
      &lt;div class="right1"&gt;&lt;/div&gt;
      &lt;div class="right2"&gt;
        Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
      &lt;/div&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://codepen.io/erenerena/pen/QWGzBre" rel="nofollow noreferrer">codepen</a></p>