3 ms·
It sounds like you want "contain: content" for almost every element, except when you're doing something like absolute positioning that's intentionally breaking
by jtolmar 7y ago
It sounds like you want "contain: content" for almost every element, except when you're doing something like absolute positioning that's intentionally breaking containment. I get that you can't make containment the default because of backwards compatibility, but I'd think there should be a "contain: none" option so you can open with "* { contain: content; }" and turn it off for the subtrees where you're actually using containment-breaking layout.
- frivoal 7y ago`contain: none` is a thing: https://www.w3.org/TR/css-contain-1/#valdef-contain-none https://www.w3.org/TR/css-contain-1/#valdef-contain-none
- _bxg1 7y agoI think that's overly-optimistic for most "web apps", which are the main use-case since this API is only useful when your DOM is enormous and it and/or your styles are changing frequently.
- The_rationalist 7y agoI invite you to read the comment I've made where I question if "* { contain: content; }" is or isn't the optimal selector.