Skip to content

Comment on My favourite 3 lines of CSSparent

Comments

Simply: gap wasn't an option when this was initially conceived.

The author's arguments against gap

I don't think it's a argument against gap. It's that this technique is advantageous in some situations. It is stated later on that grid is his choice for bespoke layouts.

what a nightmare having to manage margin at an atomic component level for everything would be instead of just spelling out a few container components

This is the essence of the technique. Specifying `* + *` allows controlling the layout of adjacent elements, rather than an atomic element. I think this would all make more sense after reading some of the precedent material: https://alistapart.com/article/axiomatic-css-and-lobotomized.... (It's actually pretty succinct, so rehashing it here wouldn't add anything.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.