w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.5k stars 661 forks source link

[css-display-4] Special Consideration(s) of Establishing Container Block #10871

Closed DYCDAMallgren closed 3 weeks ago

DYCDAMallgren commented 1 month ago

According to https://github.com/w3c/csswg-drafts/blob/main/css-display-4/Overview.bs:

In general, the [=box edge|edges=] of a [=box=] act as the [=containing block=] for descendant boxes; we say that a box “establishes” the [=containing block=] for its descendants.

And for outside of generality?

bramus commented 1 month ago

And for outside of generality?

Think of descendants that have a position: absolute or position: fixed declared on them. Those descendants don’t use the direct parent’s box as the CB but they use something else. This is described in https://drafts.csswg.org/css-position/#def-cb

DYCDAMallgren commented 1 month ago

And for outside of generality?

Think of descendants that have a position: absolute or position: fixed declared on them. Those descendants don’t use the direct parent’s box as the CB but they use something else. This is described in https://drafts.csswg.org/css-position/#def-cb

What about display: flex?

https://github.com/w3c/csswg-drafts/blob/main/css-sizing-3/Overview.bs

    Name: min-width, min-height
    Value: auto | <> | min-content | max-content | fit-content(<>) | <>
    Initial: auto
    Applies to: all elements that accept 'width' or 'height'
    Inherited: no
    Logical property group: min-size
    Percentages: relative to width/height of containing block
    Computed Value: as specified, with <> values computed
    Animation Type: by computed value, recursing into ''min-width/fit-content()''
    
bramus commented 1 month ago

That would be described in the flexbox specification: https://drafts.csswg.org/css-flexbox-1/#flex-containers