Hacker News new | ask | show | jobs
by lwhi 1630 days ago
Margins are part of the specification of CSS. Banning them would be crazy.

If you don't like thinking about them, sure .. introduce the concept of spacer elements in your framework. But outlawing something because you don't fully understand its purpose isn't the way to go.

2 comments

I would recommend reading the article, or at least the top comments here. This is not what the article is advocating.
> We should ban margin from our components. Hear me out.

Maybe the first line of the article?

The implementation of the CSS spec is closely optimised for performance by the browser. Trying to achieve the same outcome by using other means, might feel like a clever way of conceptualising .. but I'd argue there's absolutely no need.

> because you don't fully understand its purpose

How did you arrive at the conclusion that OP doesn't understand margins?

Because the author has gone to such lengths to avoid them!

Creating extra markup specifically for presentation for example ..