Re: A dedicated property to clear descendant floats (was: Proposal for "overflow:clip" for stronger painting isolation)

On Fri, Oct 18, 2013 at 1:28 PM, Marat Tanalin <mtanalin@yandex.ru> wrote:
> 18.10.2013, 19:48, "Tab Atkins Jr." <jackalmage@gmail.com>:
>> Getting a container element to contain its floats has been addressed
>> directly in the Sizing spec, though it hasn't gotten implementation
>> yet.  You can set "min-height: contain-floats;" to make it work:
>> <http://dev.w3.org/csswg/css-sizing/#the-contain-floats-value>.
>
> `min-height: contain-floats` looks somewhat interesting, but what if a web developer needs for an element to have both self-clearing _and_ some numeric `min-height`?

Hmm, I thought we were planning on making this an addition to the
current min-height, so you could specify a <length> and/or
"contain-floats".  fantasai, do you recall if there were reasons why
we wrote it the way we did, or is just a mistake?

> Using a property for something that is not directly related to it and just causes unneeded limitations looks like a spec-design mistake.

Float clearing is explicitly about making an element tall enough
and/or wide enough to contain its floats.  That is, you want the
element to be, at minimum, large enough to contain the floats.  That
sounds like min-width/height, which is why we were planning to put it
there.

On Fri, Oct 18, 2013 at 7:53 PM, Bruno Racineux <bruno@hexanet.net> wrote:
> You can always use both:
>
> min-height: 200px;
> min-height: contain-floats;
>
> The browser will surely have to adapt to either, based on the conditional
> presence of floated children.

As Marat expressed less politely, this doesn't work.  The cascade
process will result in the first declaration being ignored.

~TJ

Received on Sunday, 20 October 2013 16:53:48 UTC