DEV Community

Discussion on: The case for * { margin: 20px }

Collapse
 
steveblue profile image
Stephen Belovarich • Edited

While there may be some uniformity among parts of a design system, I don’t believe this approach is sustainable. What if the designer wants a more hierarchical margin throughout the design? Do you then override everything that requires the new margin? This approach adds unnecessary complexity. I would rather see margins explicitly zeroed out and set on specific elements that require a different margin than 0. That pattern makes for a more stable implementation of a design system.

Collapse
 
gajus profile image
Gajus Kuizinas

What if the designer wants a more hierarchical margin throughout the design? Do you then override everything that requires the new margin.

I can respond to that if you share a real-world example. A requirement that adds inconsistent spacing between elements should be seriously questioned. However, as mentioned at the end of the article, it is likely that what you are missing is another container to logically group elements.