Re: [css3-writing-modes] auto logical width in orthogonal flows

On Sun, Mar 6, 2011 at 5:58 PM, Alex Mogilevsky <alexmog@microsoft.com> wrote:
>> On Thu, Jan 6, 2011 at 1:09 AM, Koji Ishii <kojiishi@gluesoft.co.jp>
>> wrote:
>> >
>> > <div id="A" style='width: 300px; height: 200px; writing-mode:
>> > horizontal-tb;'>
>> >  AAA
>> >  <div id="B" style='writing-mode: vertical-rl;'>BBB</div>
>> >  CCC
>> > </div>
>> >
>> > I would like div B has (200px - the height of "AAA" - the height of
>> "CCC") as the maximum logical width (height) in this case, but if I
>> understand the current spec correctly, none of the options mentioned there
>> give this behavior.
>
> I believe we have discussed this on a number of occasion, including most likely the one that brought to "100vh" solution. It is tempting sometimes to take into account all surrounding (or at least preceding) boxes and use remaining available width or height.
>
> The problem with using available space is that if it is the author's intent, the author can use explicit ways to define that (e.g. in the above example use two floats for AAA and CCC, or use a flexbox). But this default size is really targeted at underspecified, unintentional case, and there using available space will often produce unusable layout.
>
> 100vh though gives at a least a somewhat usable result, nearly always.

What about using min(max-content-height, 100vh)?  That gives better
results in the examples given, where the content of the vertical-flow
elements is short, while still offering the advantages of a 100vh size
when the contents are long.

In the context of flexboxes, I'd rather have a vertical flexbox
without a 'height' be as small as possible, if its auto height would
be less than the viewport.  If its auto height would be larger than
the viewport, it's not hurt by the 100vh restriction, as it has no
notion of line-wrapping and thus will simply be as large as it needs
to be instead, just like an element containing a single giant word
that is longer than 100vh (or, in horizontal-flow, the containing
block).

~TJ

Received on Monday, 7 March 2011 02:34:42 UTC