Re: [w3ctag/design-reviews] Review of CSS Sizing 3 (#565)

We're going to assume that you're not asking for explainers for features that were originally defined in other specs like CSS2 / CSS UI Level 3 / CSS Flexbox, but only for the features which are new in this specification. These are:
    
    * the `min-content` and `max-content` keywords
    * the `fit-content()` function
    
The user needs underlying all of these are straightforward: they let authors reproduce, explicitly, useful layout behaviors that they could previously achieve as a side-effect of certain circumstances, such as floats and table layout. In particular, `min-content` is the size that a float takes if its container is smaller than its min-content size in that axis (aka "as narrow as it can get without causing overflow"), `max-content` is the size a float takes if its container is larger than its max-content size in that axis (aka "as wide as it needs to be to fit everything without text wrapping"), and `fit-content(<length-percentage>)` is the “shrink to fit” size a float takes if its container is the given size in that axis: the smaller of its max-content size and its container's size, floored by its min-content size.

Authors have long used these concepts in their layouts, but it can be awkward to trigger the correct conditions to get exactly the desired layout behavior, and depending on the circumstance can require adding extraneous wrapper elements. Adding these keywords makes these kinds of layouts easier to achieve, and substantially easier to read and understand the intent of than the previous "layout hacks" that were required. They also give us (the CSSWG) useful hooks to key off of in layout algorithms, since they meaningfully signal intent from the author about how they want the element to size.

The entire rest of the spec is defining the terminology and concepts nessary to specify how these keywords, and other foundational aspects of the CSS sizing algorithms, actually work. Most of it is dictated by behaviors existing in, but only very loosely defined in, CSS2; the only area where the CSSWG has had significant discretion is the handling of [cyclic percentages](https://drafts.csswg.org/css-sizing-3/#cyclic-percentage-contribution) and the handling of [replaced elements without an intrinsic size](https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes).

~Tab and fantasai

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/565#issuecomment-740116618

Received on Monday, 7 December 2020 19:03:34 UTC