title: CSS Grid: column-gap forces parent to overflow
body: <p>I want to achieve 12 column grid behavior similar to what Bootstrap has,
  but using CSS grids.</p>
  <ol>
  <li>I need to have a fixed gaps in pixels</li>
  <li>And have a 12 column grid, so I can decide how to place the children.</li>
  </ol>
  <p>I'm facing the issue, that combination of <code>grid-template-columns</code> and <code>column-gap</code> doesn't shrink the columns on a smaller screens, but cause horizontal overflow on a screen.</p>
  <p>How can I achieve expected behavior with shrinking without reducing the number of columns and keeping the gap in pixels.</p>
  <p>DEMO:</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>.parent {
    max-width: 300px;
    height: 500px;
    overflow: auto;
    border: 1px solid blue;
  }
  
  .box {
    grid-column: span 6 / span 6;
    background: red;
    height: 40px;
  }
  
  .grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 40px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
    &lt;div class="grid"&gt;
      &lt;div class="box"&gt;&lt;/div&gt;
      &lt;div class="box"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>