top | item 46841794

When will CSS Grid Lanes arrive?

50 points| feross | 1 month ago |webkit.org

27 comments

order

Animats|29 days ago

Here's the famous 2004 article on why tables are bad.[1] Cool people do everything with break and div. The CSS crowd then spent two decades re-inventing tables.

[1] https://www.hotdesign.com/seybold/everything.html

socalgal2|29 days ago

Tables are not responsive. They don't adjust to changing screen sizes. That was okay, maybe, when everyone was only on desktop/laptops but changed once mobile and tablets appeared.

rmunn|29 days ago

The left side of the first example picture looks to me like four columns laid out using a vertical flexbox each. In fact, it looks like the very example that I saw people using saying "Look how the flexbox layout on the left doesn't line up the text boxes, but on the right the text boxes are all neatly aligned, isn't that nicer?"

I realize that the difference is that the items are laid out horizontally, i.e. photos 1-2-3-4 are all across the top, whereas with vertical flexboxes items 1-2-3-4 would end up in the first column (or you'd have to rearrange your divs taking the flexbox layout into account, which is often impractical).

But the gain from CSS Grid Lanes is not immediately obvious from looking at the first photo, as it's so very similar to the old "left is flexbox, right is grid" examples from when Grid was new.

lee_ars|29 days ago

Looking at the comparison image between CSS grid lanes and CSS grid 1, the grid lanes example looks....horrifying. It looks like pinterest cancer. It makes the page look like a ragged assortment of random shit. Scannability is grossly impaired. How are you supposed to approach this content? What objective does this mess of a presentation accomplish? What kind of information lends itself to this kind of "masonry-style waterfall layout"?

isleyaardvark|29 days ago

There is a use case for grid lane and pinterest is a good example: random images where a user isn't looking for a particular image but is just browsing. That's also why the example looks bad, is because it prominently includes text, which isn't part of the use case. Scannability is terrible, this layout has a very limited use case. It really is only for browsing random images, not even searching for a specific image and definitely not concerned with text.

socalgal2|29 days ago

A feature I want, that appearenly was attempted by some browsers but never stanardized. I want to be able to make a table that can responsively fill out columns.

    +-------+------------+  +-------+------------+  +-------+------------+
    | state | population |  | state | population |  | state | population |
    +=======+============+  +=======+============+  +=======+============+  
    |  AL   | ....       |  |  DE   | ....       |  | MI    | ....       |
    |  AK   | ....       |  |  FL   | .....      |  | MN    | ....       |
    |       |            |  |       |            |  |       |            |  
I need to put the heading at the top. It needs to make the heading sticky. As it is those, AFAIK there is no "easy" solution for this

dsego|29 days ago

Does subgrid work for this layout?

avmich|1 month ago

I wonder when we'll get hexagonal lanes, triangular and Penrose tiling. Rest assured, there will be practically infinite set of features designers would invent. Language designers would do good takubg into account Scheme idea: language is good when there is nothing to remove.

jauco|1 month ago

But css is not a “programming language” it’s a negotiation between browser engineers (who need to keep things fast and responsive) and web devs (who need to implement a fashionable design that is still distinguising for their brand)

TheAceOfHearts|1 month ago

I think the plan going forward is to allow people to implement their own CSS layout primitives using Houdini, but I haven't kept track of how it has evolved or progressed.

LoganDark|1 month ago

IIRC, there are no directions in CSS other than the block and inline axes.

sph|29 days ago

The more features they add, the less likely a competitor can arise without investing a billion man-hours.

bob1029|29 days ago

This seems kind of redundant. I would just use flexbox for something like this. Grid is already an extremely rare item for me. I only ever use it when I need to control the overall layout for an app that has to work on a wide range of viewports. I'd never use grid just because it can do clever brickwork.

aniforprez|29 days ago

You very much cannot use flexbox for this. The whole point of these gridlanes is that not only can you have elements that automatically move across lanes when resizing the container, you can also have elements spanning multiple gridlanes and also fix the positions of elements in the grid, something wholly impossible in pure CSS flexbox. They link to the article[1] that even describes all the use cases this covers right below the first image.

Grid covers a lot of very subtle use cases that have historically required hacks like a list of select options where some can have icons on the left and some don't. You just need a subgrid that will automatically position every element in the select correctly to align them, regardless of whether there is an icon or not within the element in all select items. Previously you'd have to add a fixed width padding to the left and check if all the select items had icons. It also correctly scales the width and height of a row of items like cards where you want to ensure the alignment of headers, content, image etc depending on if that stuff is in there or not. You can have text missing and the card will still take up that size because your subgrid has defined it so. All of this needed JS, complex CSS hacks and so on. These aren't obscure features these are commonly used layouts that required a lot of time and effort to make it look nice.

[1] https://webkit.org/blog/17660/introducing-css-grid-lanes/

hollowturtle|29 days ago

Did we really need that? I wonder if people recognize how bad the "standard committee" is and that we are held back by them. I can't hold in my mind how many features the web is missing that should be prioritized, I think I'll make a list and start a blog. The web deserve better