The ‘contain’ CSS property
developer.mozilla.org
developer.mozilla.org
This page got me a bit closer I think: https://css-tricks.com/almanac/properties/c/contain/
The intended use of course is ensuring that the content in container does not need complex compositing outside its rectangle.
As someone that has been working with css for over a decade, I was surprised to find out about the contain property, as I had never known about it and it seems extremely useful for hinting to the browser of optimizing DOM operations.
If anyone with experience writing DOM/layout code for browsers knows anything about whether these optimizations are indeed used/meaningful, that would be stellar!
(I've got that and your link open but haven't read either yet, more coffee first, just wanted to make sure you didn't miss the other user's link :)
A quick way to validate that is to open up the devtools and run a performance trace. Watch for paint events vs JS code execution and such.
Today, someone can become pretty good with CSS without ever considering how the Box Model will impact a container/wrapper.
Wholly agree with your second point, it's something I see from a lot of junior devs. They just reach straight for flex/grid, and tbh I don't blame them. They are more predictable layout algorithms that are largely unshackled from legacy layout decisions.