CSS is terrible because it is global state

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com

CSS is broken because the style sheets are global. Once upon a time, this didn’t seem terrible because it was thought that CSS would operate as CONSTANTS. But they are not constants. On any modern website or app, the styles are always changing. So the styles are really a global variable, and they have all the problems that 60 years of computer science has taught us to expect from global variables.

There are other problems with CSS. Perhaps the biggest is margin and padding, which introduces a new paradigm for layout. Ideally, margin and padding should be added at some high level, above the basic design language. Start with a design language that does not have margin or padding, just boxes, and then in software such as Adobe Dreamweaver, you can make it easy for users to create two boxes, one inside the other, and Adobe can tell its users that this is “margin”. That would be the right level of the tech stack to add the idea of margin or padding. But margin and padding should not be in CSS.

Also, see CSS Is Broken.

Source