Hacker News new | ask | show | jobs
by mhink 860 days ago
They *have* come together. That's why we actually have several options built for purpose and native to CSS these days, as opposed to relying on hacks and Javascript (which was surprisingly common even as recently as 5-6 years ago. The name of this article is more or less a joke, because most people with any experience will recognize that since Flexbox and Grid have become widely available, the answer is generally "use Flexbox or Grid". Knowing the nuances of these layout algorithms is table stakes for building UIs that don't feel "janky".

The problem with designing and implementing application layouts for the Web is that it's such a dynamic medium. You can't ever rely on a particular viewport size, and you generally can't rely on content size either.

Like, just as a simple example: build me a page which has a white background and three blue boxes in the middle which contain white text saying "foo", "bar", and "Supercalifragilisticexpialidocious".

How big should these boxes be? Should they even be the same size? How should text wrap within them? How should the text itself be aligned within the boxes? When you say the "middle", do you mean centered vertically or horizontally? Are they laid out in a row or in a column? What's the expected behavior when the viewport size is too small to accommodate them? Should the boxes themselves wrap in some special way? Should they resize themselves?

This isn't even really splitting hairs or anything, it's just sort of the mindset you get into when you start working within a domain that's governed by *constraints* rather than specific sizes.