DEV Community

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

Collapse
 
stereobooster profile image
stereobooster

I don't hate CSS, but I find a lot of it confusing:

  • global scope, so change in one file would cause a change in different
  • specificity is ok, but !important and the fact that some properties are inherited and some are not :/
  • CSS visual formatting model - it got much better with flexbox and CSS grid
  • margins/paddings - it got better with box-sizing: border-box;
  • no debug tools - it got better with Firefox and Chrome dev tools, but sometimes you need to get through 10 elements before you find what actually shifts your element
Collapse
 
itsmenatalie profile image
Natalia

I was thought that if you are using !important that means you f*cked something up earlier :P But I know there are some edge cases :)
And I've never used box-sizing: border-box; tbh. I never needed that O.o

About global scope - yes, that's disgusting sometimes that why it's so important to keep everything structured so much. And I really love libraries like CSSModules which helps with that a bit :)

Collapse
 
stereobooster profile image
stereobooster

if you are using !important that means you f*cked something up earlier :P But I know there are some edge cases :)

The problem is that it could be not me, it could be somebody else on the team (and reviewer haven't noticed it), or it is 3rd party code. The presence of the feature itself means that somebody would use it eventually.