Live data from Hacker News

Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

webkit.org

111–120 of 359 posts

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#111
post #22

If the designers of Unix had seen the light of CSS, they wouldn’t have bothered with shells and file descriptors and C and Awk and all that composable flotsam. They’d just created a single program, call it the “Central Software System”, and defined thousands of properties that let you control its state machine to produce the output you need. Presto! The perfect computer. If for some reason someone needs a new kind of…

I didn’t realize this was satire until the second paragraph. Well done.

As a firmware engineer who is trying to build a website in his spare time, I find CSS absurd. I’ve found SCSS and Sass make it much more bearable. The ability to represent a hierarchy concisely is awesome.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#112
post #49

Earlier quoted context omitted.

For awhile it was just described as "Pinterest style." It has some use cases but for the most part it's literally a wall of unstructed information. Difficult to parse and build any mental hierarchy. It's also ... incredibly easy to do with existing css.

> incredibly easy to do with existing css care to demonstrate? given a dynamic collection of images where you don't know the aspect ratios beforehand

Does it actually solve that problem, though?

In the photo demo all content is either 1-column or 2-column wide - and that already results in some very noticeable gaps. I don't get the impression that it can properly handle arbitrary aspect ratios. You're pretty much forced to stick to a single column width and fit all images to match, so not exactly an improvement over what we already have right now.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#113
post #60

Earlier quoted context omitted.

And with this convenient domain excuse, CSS has managed to become a system that’s not a fit for any domain. It’s incomprehensible to visual designers, incomprehensible to programmers, and incomprehensible to document authors. On the upside, it provides a massive moat of sunk cost and implicit implementation dependency around Chromium, so at least there’s that.

It’s always funny to read people that just never understood CSS trying to convince everyone that CSS is impossible to understand!

it's better on HN because you can get it combined with snide insinuations that they could have created a better layout system that would do all the things that CSS does, but also fix the various problems that CSS has.

However the glory days are evidently behind us, because these insinuations never end with "in a weekend" anymore.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#114
post #111
post #22

If the designers of Unix had seen the light of CSS, they wouldn’t have bothered with shells and file descriptors and C and Awk and all that composable flotsam. They’d just created a single program, call it the “Central Software System”, and defined thousands of properties that let you control its state machine to produce the output you need. Presto! The perfect computer. If for some reason someone needs a new kind of…

I didn’t realize this was satire until the second paragraph. Well done. As a firmware engineer who is trying to build a website in his spare time, I find CSS absurd. I’ve found SCSS and Sass make it much more bearable. The ability to represent a hierarchy concisely is awesome.

CSS is adding native nesting: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting...

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#115

Umm. Can't you just make each column a subgrid within a larger grid that has one row? It seems like either these constructs are poorly designed, or people don't see how to use them to get what they want.

As I understand it, the hard part of a masonry layout is ensuring that items are laid out with the first items near the top of the screen and the last items near the bottom of the screen.

If you just plop your items into columns, the first items will all appear in the first column and the last items will all appear in the last column (left to right), which is not the behavior you want.

To my knowledge, the correct behavior cannot currently be created in CSS alone. (Or if it can, it must be a wild hack.)

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#116
So, the background story is that CSSWG DevRels from browser vendors are debating how to formally include the Masonry layout into CSS, at least since 2020, when Firefox first proposed it.

The news here is that people at WebKit decided to push the debate to the public, inviting designers and developers to take some action (“post to social media, write blog posts”), in order to get past this.

While it may look just like a formality, I think this will make an important precedent. The real underling debate here is either to treat every layout option as a part of the CSS Grid, or keeping adding new CSS Display proprieties as necessary.

The first option will make even more complex the (already convulsed, IMHO) CSS Grid specs, the latter will bloat the CSS specs with a load of new proprieties (and related sub-proprieties).

Either way, it's not as easy as it looks.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#117
post #60

Earlier quoted context omitted.

And with this convenient domain excuse, CSS has managed to become a system that’s not a fit for any domain. It’s incomprehensible to visual designers, incomprehensible to programmers, and incomprehensible to document authors. On the upside, it provides a massive moat of sunk cost and implicit implementation dependency around Chromium, so at least there’s that.

It’s always funny to read people that just never understood CSS trying to convince everyone that CSS is impossible to understand!

I'd be surprised to hear anybody with intimate knowledge of CSS claiming to understand CSS.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#118
post #60

Earlier quoted context omitted.

And with this convenient domain excuse, CSS has managed to become a system that’s not a fit for any domain. It’s incomprehensible to visual designers, incomprehensible to programmers, and incomprehensible to document authors. On the upside, it provides a massive moat of sunk cost and implicit implementation dependency around Chromium, so at least there’s that.

It’s always funny to read people that just never understood CSS trying to convince everyone that CSS is impossible to understand!

Yes, that's fair.

Sure, today we have grid and vanilla CSS is sane and useable by anyone who takes the time to learn the modern way of doing things.

But let's not forget what a long and tortured road CSS has taken to become what it is today. CSS was a total dumpster fire up until around when flexbox came out. It was SO HARD to make it do what you want for SO LONG.

The MOST BASIC NOTION of layout, putting things in a freaking grid, was missing from CSS for almost two decades. Yet, the grid concept has been around in application layout since the 1980's. I can't explain why it took CSS such a long time, and the explanations I've heard don't seem plausible to me.

It's understandable that folks who were around in the bad days of CSS are still kind of bitter. I was, and if I didn't take the time to see the new ways of using it, I would still be incredulous about CSS.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#119
post #82

Earlier quoted context omitted.

Maybe you need better glasses. This proposal is coming from the Webkit team, ie. Apple. CSS is plenty comprehensible and using it gets better with every browser release as they are focused around yearly interoperability efforts.

I happen to quite like CSS (in comparison to any other layouting system out there), but I really wouldn't characterize it plenty comprehensible. I'm quite certain there's no human on earth that could reliably predict the outcome of most non-trivial real-life CSS layouts given just the code. And even though the situation has improved a lot, it's still common to have to use clearfixque hacks that definitely weren't env…

Isn’t that true for most software? Do you think you can simulate the outcome of a semi complicated Python Codebase just by looking at it? That’s just an intrinsic property of the problem you’re dealing with, adaptive page layout will always be complicated and not easily understandable just by looking at code.

Re: Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout

#120

Earlier quoted context omitted.

JavaScript is the final layout system. No declarative language can ever handle every use case. Fortunately I rarely need to resort to JS since grid came out. I’m not sure a constraint based system would do much good as it would sit awkwardly in the middle of grid and JS.

> No declarative language can ever handle every use case. Prolog would beg to differ.

So would LISP, Haskell, and Erlang.
Post reply on HN