4 ms·
the title is a bit clickbaty, it should be written as: where to use margins when building web components. you are just saying that you have to place margin in t
by hamedb 5y ago
the title is a bit clickbaty, it should be written as: where to use margins when building web components.
you are just saying that you have to place margin in the container of the component not inside it. that's it!
Anyways, I think the answer is "it depends" and there's no silver bullet when it comes to micro CSS details.
CSS is always controversial when it comes to how structure it and I don't think this type conversations are useful or add anything to front end. it's just a waste of time as the end result only matters.
we can argue for days to both sides on where to place margins and we will never find the "perfect" way.
I am a big believer front end developers will move to low code tools for CSS such as https://intab.io https://intab.io to style their CSS in the near future and focus more on the end result rather than waste time arguing on this micro details. take a way, focus on the end result rather than these trivial things!