Dev Helpers
← Back

Increase grid columns at a breakpoint

Increase grid columns at a breakpoint with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    display: grid;
    gap: 0.5rem;
  }
  @media (min-width: 40rem) {
    .demo {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
</style>
<div class="demo">
  <span class="tile">One</span><span class="tile">Two</span
  ><span class="tile">Three</span>
</div>