T
6

Showerthought: Why does every framework insist on resetting all my margin values?

I burned 4 hours last Tuesday fighting a CSS bug on a client's landing page because Tailwind's preflight reset nuked all my carefully set margins on a form layout. Turns out the default box-sizing and margin reset was working against me the whole time. Is stripping global styles really worth the convenience or does it just create more headaches for developers who know what they're doing?
3 comments

Log in to join the discussion

Log In
3 Comments
zarak18
zarak181mo ago
I spent like 3 hours last month on a checkout page because Tailwind's preflight took away all my margin on radio button groups. I had to wrap everything in a div just to get spacing back. It's annoying when you know exactly what you're doing and the framework assumes you need handholding. Do you just turn off preflight entirely now or did you find a smarter workaround?
7
paul_burns
paul_burns1mo ago
Man, tell me about it. I spent a whole Saturday once trying to get a simple contact form to line up right on a real estate site I was building. Turned out the CSS reset was killing the margin on my submit button and making it stick to the bottom of the form. Ended up having to manually add every single spacing rule back in. Makes you wonder if saving a few lines of code is worth the headache when you're already past the basics.
5
rowanp15
rowanp1523d agoTop Commenter
120% agree with you @zarak18, it's like the frameworks are trying to parent us. I once spent a whole afternoon debugging a button that refused to center in a modal. Turns out the CSS reset was aggressively removing my flexbox properties. I had to write like 15 lines of custom CSS just to get a button to sit in the middle of a box. It's ridiculous when you're a grown developer who knows what they're doing. Makes you wonder if these resets are really saving time or just creating busywork for people who already understand spacing.
2