Grid Lanes (CSS-only masonry)

Safari 26.4 (April 2026); Chrome, Edge and Firefox behind flags. Not Baseline.

Chrome flagEdge flagSafari 26.4Firefox flag

A masonry-style layout where items flow into the shortest column lane, expressed with `display: grid-lanes` and the familiar grid track syntax. No JS masonry libraries.

1
2
3
4
5
CSS
.fx-060 {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(120px,1fr));
  gap: 10px;
  font-family: system-ui
}
@supports (display: grid-lanes) {
  .fx-060 {
    display: grid-lanes
  }
}
.fx-060 div {
  background: #e0e7ff;
  border-radius: 8px;
  display: grid;
  place-items: center
}
HTML
<div class="fx-060"><div style="height:80px">1</div><div style="height:140px">2</div><div style="height:60px">3</div><div style="height:120px">4</div><div style="height:90px">5</div></div>

Fallback: The regular grid above is the fallback (rows align, gaps appear under short items).

Source: webkit.org/blog/17862/webkit-features-for-safari-26-4/

Prompt

For Pinterest-style layouts use `display: grid-lanes` with `grid-template-columns: repeat(auto-fill, minmax(...))` inside `@supports (display: grid-lanes)`, with a normal grid as the fallback. Safari 26.4+ only in 2026-09; do not add a masonry JS library.