Today I learned

Margin considered harmful

Edit this Post Opens in new tab

Today I learned that margin can be considered harmful in some cases. Max Stoiber tweeted about this and a lot of people, myself included, agree.

Many developers use margin to add space between components. This makes the reusability of a component really hard. As Max puts it:

"A well-built component should not affect anything outside itself."

I'm using Slot-Components whenever I want to add extra space between Components.

Learn more:

I hope you enjoyed this post and learned something new. If you have any questions, feel free to reach out to me on Twitter Opens in new tab or via Email Opens in new tab.

If you want to support me, you can buy me a coffee. I would be very happy about it!

☕️ Buy me a coffee ☕️

I wish you a wonderful day! Marco