DEV Community

Discussion on: Why is CSS Hated On?

 
facundocorradini profile image
Facundo Corradini

You can with a rule such as "color: red". The color is going to be red, unless overwritten in a high-specificity selector or something that takes priority on the cascade.

But how about something like "flex-basis: 200px"... that doesn't tell you anything on its own. Doesn't even tell you if it's width or height, as it would depend on the flex-direction. Doesn't really tell you how big it's going to be, as that would depend on the siblings' flex-basis, their flex shrink and flex grow values, the container width, the margin, padding and box-sizing, etc

Actually, it doesn't even tell you if it's going to do anything at all, as that depends on whether the parent is a flex container or not.

Thread Thread
 
gabrielpedroza profile image
Gabriel Pedroza

Yeah, now I do understand what you mean by CSS being extremely dependent on context. Now you saying that, it dawns on me that every single property could have the potential of not working if the html elements have inline-styles to it. Thank you for going out of your way and truly explaining this to me