Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

WebKit 8 min read Announcement mediumAdept

Introducing CSS Grid Lanes

CSS Grid Lanes (`display: grid-lanes`) brings native masonry layouts to the web, available in Safari Technology Preview 234. Lanes are defined with standard `grid-template-columns` or `grid-template-rows`. Each item goes into whichever lane leaves it closest to the start, so tab order follows visible content and infinite scroll needs no JavaScript layout. Grid features such as spanning, explicit placement and varied lane sizes all work, and flow direction (waterfall vs. brick) is inferred from which template is defined. A new `fit-tolerance` property (default 1em, formerly `item-tolerance`/`flow-tolerance`) treats near-equal lane heights as ties to reduce reordering that confuses keyboard and screen reader users.

Related posts

  • When will CSS Grid Lanes arrive? How long until we can use it?

    WebKit mediumAdept

    CSS Grid Lanes, the masonry-style layout from CSS Grid Level 3, ships with its finalized `display: grid-lanes` syntax in Safari Technology Preview. Firefox has an older flagged implementation using `grid-template-*: masonry`, and Chromium is updating its alternative implementation to the agreed syntax. Developers can adopt it now with progressive enhancement in one of three ways: feature-query and conditionally load Masonry.js only where `CSS.supports('display','grid-lanes')` fails, fall back to Multicolumn (which flows content in a different order and changes tab order), or declare `display: grid` then `display: grid-lanes` so unsupported browsers keep a Grid Level 1 layout. In the Grid fallback, `aspect-ratio`, `object-fit` and `-webkit-line-clamp` force the cards to equal sizes.

  • Help us choose the final syntax for Masonry in CSS

    WebKit mediumAdept

    WebKit argues that masonry-style packed layout should be specified as part of CSS Grid ("Just Use Grid", e.g. grid-template-rows: collapse) rather than as a separate display: masonry mode with its own masonry-* properties, as the Chrome team and Rachel Andrew propose. Performance concerns about combining masonry with full Grid track sizing have been resolved, and the CSSWG has adopted mixed track sizing in the Grid Level 3 First Public Working Draft. The remaining dispute is purely syntactic. WebKit cites Bert Bos's design principles (learnability, minimum redundancy, repurposing) and shows side-by-side code where a separate syntax duplicates nearly every grid property and forces developers to switch mental models at breakpoints. The debate was later settled under the name CSS Grid Lanes.

  • Help us invent CSS Grid Level 3, aka “Masonry” layout

    WebKit mediumAdept

    CSS Grid Level 3, often called masonry or waterfall layout, adds `grid-template-rows: masonry` so content packs into columns without rows, with no JavaScript and no cropping. Building it into Grid rather than a separate `display: masonry` keeps Grid's full column-sizing power: mixed fixed and flexible tracks, fr ratios, max-content, minmax and auto-fill. It also keeps spanning, subgrid and explicit placement, which enable layouts like asymmetric photo galleries, mega menus and lively article listings. The WebKit team demonstrates these with live demos and asks developers to weigh in on the CSS Working Group debate. An update notes that a W3C Working Draft now includes these abilities, while the syntax is still unsettled.

  • Item Flow – Part 2: next steps for Masonry

    WebKit mediumAdept

    WebKit argues that masonry-style layouts should be treated as a variant of CSS Grid. Under its proposal, the layout is triggered with `display: grid` plus the proposed Item Flow properties (`item-flow: row collapse`) rather than a new `display: masonry` value. The post works through the two open CSS Working Group questions: how to switch into masonry, and whether `row`/`column` should describe the flow of items or the shape of the resulting layout. The two readings diverge only in masonry, where items flow one way and tracks form the other. A December 2025 update notes the CSSWG abandoned Item Flow and adopted Grid Lanes instead, so the proposed syntax is now historical.

  • WebKit Features for Safari 26.4

    WebKit mediumAdept

    Safari 26.4 ships 44 features, 191 fixes and one deprecation, headlined by CSS Grid Lanes (`display: grid-lanes`) for masonry-style layouts with `flow-tolerance` control, WebTransport as a low-latency WebSocket alternative, and the Keyboard Lock API. Most of the release focuses on spec alignment and interoperability: name-only container queries, `min()`/`max()`/`clamp()` in `sizes`, MathML typography (`math-depth`, `font-size: math`), extensive CSS `zoom` fixes so zoom applies at used-value time and `getBoundingClientRect()` returns scaled values, and scroll-driven animations moved to the compositor thread. The ongoing layout engine rewrite finishes blocks-in-inline layout, continues Flexbox and begins CSS Grid, and developers are asked to file reduced test cases at bugs.webkit.org.

The quest for software engineering knowledge.

Look:
Layout: