logoalt Hacker News

CSS Grid Lanes

573 pointsby frizlabyesterday at 10:13 PM162 commentsview on HN

Comments

culiyesterday at 11:38 PM

Props to the Safari team. They surprised us all when they suddenly shot to the top of interop-2025 this October

https://wpt.fyi/interop-2025

show 11 replies
wackgettoday at 3:12 AM

I wish they'd release CSS Gap Decorations: https://developer.chrome.com/blog/gap-decorations

I'm tired of having to use stupid hacks to get nice-looking borders between flex/grid items.

show 1 reply
jonahyesterday at 10:29 PM

This is exciting to see! I just used Masonry for a project this past week. While it works quite well and is pretty performant, it is pretty hacky using absolute positioning, wanting to know the aspect ratios of objects beforehand for smoother layout, and having to recalculate everything on resize. I'm looking forward to having a generally available native option one of these days.

show 1 reply
prakashn27today at 12:31 PM

That makes sense. Safari is so smooth now in iOS. Moved from Firefox.

nehalemtoday at 11:38 AM

There is an element of tragic comedy to those announcement. While remarkable on their own, everybody knows that one cannot use any new browser feature reliably any time soon due to Apple not shipping continuous updates to the browsers they force upon their users.

show 1 reply
emilbratttoday at 12:33 AM

I always thought that the masonry layout looked good but made it harder to get a good overview of the images.

show 2 replies
ray_vtoday at 1:43 AM

If I ever encounter, and need to read a webpage with arbitrarily sized and placed grids of text, please somebody just shoot me. https://webkit.org/wp-content/uploads/Grid-Lanes-newspaper-d...

show 6 replies
ricksunnytoday at 6:41 AM

I wonder how long it takes LLMs to correctly ingest fresh CSS notation like this.

uniq7yesterday at 11:59 PM

Maybe this will be an unpopular opinion, but I really dislike the lane layout, because it is not possible to efficiently take a glance at all elements in the list, one by one.

If you try to go left-to-right, you will quickly realize that at the end of each "line" it is really difficult to know where the next line starts. It is easy to accidentally start again on the same line (and inspect the same elements), or skip one accidentally. Then navigating through the elements one by one requires a considerable amount of cognitive effort, your eyes bounce up and down constantly, and you end up inspecting the same elements multiple times.

If you try to go top-to-bottom, lane by lane, you will then realize that the page also has infinite scroll and you will never go past the first lane.

show 5 replies
intersticetoday at 11:13 AM

Kinda odd they didn't call it masonry given it's already been called that forever. At least grid-lanes is reasonably self explanatory.

todotask2today at 7:20 AM

I think Apple should make Safari stable downloadable option for all platforms.

show 1 reply
acjohnson55today at 1:09 AM

Very cool! I wonder, will it be easy to build interactive interfaces on this primitive, like animations and drag-and-drop?

ThatMedicIsASpyyesterday at 10:59 PM

I've run the masonry layout (for my personal bookmark website) ever since I've found it in the browser settings.

grid-template-rows: masonry;

is going to be outdated then?

show 2 replies
jbrittontoday at 12:00 AM

I have often thought layouts should be done by a constraint solver. Then there could be libraries that help simplify specifying a layout, which feed constraints to the solver.

show 2 replies
jeroenhdtoday at 12:19 AM

I have to ask, like with all the other browser specific trial implementations: how is cross platform support? If we wanted to make a grid layout that only worked in one browser engine, grid-template-rows: masonry was there for a while now.

Chromium still seems to be working on support it seems based on https://cr-status.appspot.com/feature/5149560434589696 so maybe it'll be useful soon? That page indicates that they're still discussing certain parts of the spec.

show 1 reply
oefrhatoday at 12:42 AM

I've been using Chromium's display: masonry in some internal apps since they introduced it behind a flag in Chromium 140. Looks like they just have to rename it now?

show 1 reply
swyxtoday at 12:55 AM

how does it work with animations? like if i transition:all and then remove a middle img does the other elements get animated?

show 1 reply
nitwit005yesterday at 11:45 PM

How would you query the location where you need to load more data when scrolling down (the highest empty spot)?

show 3 replies
nakedneurontoday at 8:19 AM

Is there anything to be said about accessibility? Found the word only once in the comments.

memonkeyyesterday at 10:32 PM

Masonry grid layout was one of a few interviewing pair programming tests I would give to frontend engineers. I need to see how this works under the hood!

imbnwatoday at 7:29 AM

What’s the best resource for getting a handle on all modern CSS for someone who hasn’t paid attention since flex box

show 2 replies
cod1ryesterday at 11:46 PM

sweeeeeeeeeeeet

snoooooooooooretoday at 1:10 AM

Is anyone working on actual css problems instead of this sugar syntax?

Hypermedia suffers because these marketing companies waste time on making sure they can build Pinterest in 10 LoC instead of fixing actual long running hypermedia domains.

show 1 reply
phoronixrlyyesterday at 10:52 PM

Oh, how cool! Another barrier to a new browser gaining user base!

brcmthrowawayyesterday at 11:31 PM

I don't understand all the busywork goes behind new browser updates, just to retain their market share (since they can afford more engineers, than say Ladybird). Is this needed? It's not rocket science, folks.

show 2 replies
GaryBlutotoday at 5:22 AM

To quote the wise Karl Pilkington: "Do we need 'em?"

HTML has become more and more bloated. How many methods do we need to do something that was possible back in the 90s?

show 3 replies
valleyeryesterday at 10:52 PM

Is this increasing complexity in the Web layout world worth it? Anyone who wants to use this is going to drop support for older browsers (and, in so doing, older machines that can't run newer OSes and newer browsers).

Personally, I use an 11-year-old machine and have had to add userscript hacks to certain major Web sites to work around bugs in CSS grid (not the "lanes" described here).

At least new JavaScript features can be "polyfilled" or whatever. Maybe sites could check for CSS feature support too? But they seem not to.

For example, the demo page linked in the article fails pretty unusably for me. All the images take up nearly the full viewport width.

show 11 replies