Earlier quoted context omitted.
or you could maybe read the article before looking at its source code for a gotcha?
or may be we should continue looking for gotchas when it comes to clickbait misleading titles and finally get the message of "clickbait is wrong" across to at least some part of tech blogging community?
Use spacer components instead of CSS margins (2020)
61–70 of 230 posts
Re: Use spacer components instead of CSS margins (2020)
#62Earlier quoted context omitted.
Bingo. Author will be fighting an uphill battle on HN because of the lack of specificity (an appropriate problem for a CSS article)
Or people could just read the very short article instead of instantly assume stuff based on the title here.
Simply put, it’s not a good article.
Re: Use spacer components instead of CSS margins (2020)
#63Earlier quoted context omitted.
Thing is, clickbait works, so people will continue doing it. All your "gotcha" showed was that it works. Look at all the people in this thread engaging with this post, not because of its content but because of its title. If a clickbait title will lead to higher engagement, why would an author not use it? The best way to combat clickbait is to not fall for it, not play into it, to either ignore the article, or to read…
My gotcha and the negative reaction to it shows only that the majority of readers are ok w/ using of clickbait titles. That's a pity. Although bringing attention to such things always gets negative reaction in the beginning. Not the reason to stay silent anyway. > If a clickbait title will lead to higher engagement, why would an author not use it? Out of intellectual/professional honesty e.g.?
I think most of us come to Hacker News for interesting discussions, and the torrent of confidently incorrect "this person is wrong" comments is not adding anything to any discussion.
The top comment is already clarifying the title, so any other comment should be unnecessary, especially snarky ones.
The gotcha is another problem in itself: not only it comes from a misunderstanding of the post, a lot of people don't have control over their publishing software, but their advice should be judged on its own merits, not on some "you criticise society yet you participate in it" way [1].
[1] https://knowyourmeme.com/memes/we-should-improve-society-som...
Re: Use spacer components instead of CSS margins (2020)
#64What I would like is for a mobile site to both increase text size and reflow its contents as I pinch to zoom in on the site. Is it too much to ask ?
Re: Use spacer components instead of CSS margins (2020)
#65Ban layout styling from your components entirely if you can. Make everything headless (eg https://headlessui.dev/ , https://www.radix-ui.com/ , plain old HTML, etc). Leave the way things look up to the app that uses them.
Re: Use spacer components instead of CSS margins (2020)
#66mmm, spacer elements. the new 1999 is looking pretty awesome.
Here's the example linked by the article: https://seek-oss.github.io/braid-design-system/components/St...
Re: Use spacer components instead of CSS margins (2020)
#67Ban layout styling from your components entirely if you can. Make everything headless (eg https://headlessui.dev/ , https://www.radix-ui.com/ , plain old HTML, etc). Leave the way things look up to the app that uses them.
A ground up HTML rewrite is needed.
Re: Use spacer components instead of CSS margins (2020)
#68Ban layout styling from your components entirely if you can. Make everything headless (eg https://headlessui.dev/ , https://www.radix-ui.com/ , plain old HTML, etc). Leave the way things look up to the app that uses them.
The headless components need to be styled in the end, and the guideline present in the article still applies to those cases: outer margins in components causes some headaches.
Re: Use spacer components instead of CSS margins (2020)
#69Re: Use spacer components instead of CSS margins (2020)
#70Needs (2020) in the title. Original discussion, 123 comments: https://news.ycombinator.com/item?id=22676442 Anyway, considered harmful articles considered harmful . There is a time and place for margins. Being thoughtful with them is a better approach than "banning margin from all components." Should I really ban the use of `margin-left: auto` when positioning my flexed elements? I don't think this article is actuall…
A margin is contextual, so a reusable component shouldn't have them. It's a shame that CSS doesn't allow the parent element to define how spacing around the child elements should work.
parent > * {
...
}
There might be things missing to achieve whatever result you desire, but CSS does allow a parent element to define how spacing (and any other styling) works for child elements.