DEV Community

Discussion on: Monkey CSS

Collapse
 
leandroreschke profile image
Leandro Reschke • Edited

I think CSS tries to cover as many use cases as possible that it turns out to make it complex.

I agree about z-index, we need a better and modern version of it. I hate it.

About margin I think you are using it wrong, you should add it to the bottom or top with the exact size you want. CSS is helping you realize that if both margins between "P" elements were added together you'll end up with an inconsistent result of having 30px between elements, but 15px in the top of the first one and in the bottom of the last one.

Last, CSS units caused me a lot of pain before I started to understand that it really depends on your use case. It is just like real world measurement where you can use inches, meters, centimeters and so on. Right now I made peace with it by using only REM, and declaring on html { font-size: 62,5%;}. Most browsers today uses 16px as default font-size, by using 62,5%, you get 10px from it. That means, REM become easy to use, because if you want 22px, you use 2.2rem.

Great post by the way, I hope I didn't sound rude, I really love CSS with all the problems it has, It is great to see people talking about it. Thanks!

Collapse
 
po0q profile image
pO0q 🦄

Agree with you on z-index and rem. Actually, I apply the same margin on top and bottom, it was just an example to explain why it collapse vertically, but maybe that's not clear enough in the post.