Hacker News new | ask | show | jobs
by the_other 1629 days ago
"Banning margin" is excessive and clickbait-y.

The Spacer components idea is fine. Using Grid or flex layout in spacers is very sensible. But you could also use margins.

``` .spacer-stack * + * { margin-top: 1em; } ```

1 comments

That's... what the article said. He's not saying don't use margin for anything, he's saying avoid giving your components margin. The Spacer component is literally just the CSS you posted.
There's something like 5 instances of clear rejection of the use of margins in the article and zero mentions of practical margin-based layout strategies. I stand by my assertion that the article is badly worded.