DEV Community

Discussion on: What do you hate the most in CSS and why?

Collapse
 
ulitroyo profile image
Uli Troyo • Edited

It did use to be tricky, I'll admit!

  • Before the box-sizing: border-box property, padding used to add to the overall size of a container, so if you had a div that was 300px with a padding of 5 px, you would need to remember that your div would now be 310px.

  • Before Grid and Flexbox, everyone would have to play around with float properties and z-indexing, which is sometimes a little like trying to keep oil bubbles in water neatly organized.

  • And before fr-units and maybe the calc function (which itself is mathy and thus not really ideal), you used to have to do weird math yourself, like if you had three columns you might have to manually subtract percentages from gaps and wind up with things like "31. 3333% 5px 31.3333% 5px 31.3333%".

It's the reason why people reached for pre-made grid systems like the infamous and then-handy 960 Grid (which hilariously still exists, though I guess that's good from a historical viewpoint), and later for CSS frameworks like Bootstrap and Foundation... which sadly, a lot of people still do, and which drives CSS senseis Jen Simmons and Rachel Andrew crazy.

But I agreeβ€”I think plenty of devs are not giving themselves enough credit and just learning modern CSS.

Thread Thread
 
deciduously profile image
Ben Lovy

trying to keep oil bubbles in water neatly organized

I have never heard this put better.