Re: [css-grid][css-align] Intrinsic size of replaced elements, and no shrink-to-fit algorithm

On 05/18/2015 05:43 AM, Manuel Rego Casasnovas wrote:
> On 15/05/15 23:38, Tab Atkins Jr. wrote:
>> On Fri, May 15, 2015 at 2:28 PM, François REMY
>> <francois.remy.dev@outlook.com> wrote:
>>>>>> Are you looking at
>>>>>> http://dev.w3.org/csswg/css-align/#justify-self-property for the
>>>>>> definition of "stretch"? Note that this is different than the
>>>>>> justify-content definition.  In particular, it'll shrink too-big things.
>>>>>
>>>>> I'm speaking about the default behavior of a grid item. I'm not sure what is
>>>> the default value of all the align properties in the case of a grid, though.
>>>>>
>>>>> I would be interested in what happens in both cases though.
>>>>
>>>> Just read the spec; "auto" computes to "stretch", and "stretch" makes it
>>>> match the size of the alignment container (without regard as to whether it's
>>>> bigger or smaller).
>>>
>>> Hum, this isn't what I implemented. I am pretty sure this was the behavior I initially implemented and I got feedback this wasn't the expected behavior. In particular, both IE and Chrome seem not to shrink-to-fit by default.
>>>
>>> Am I missing something?
>>
>> What the spec now says and what early implementations are doing don't
>> always match up. ^_^
>
> This reminds me to this thread:
> https://lists.w3.org/Archives/Public/www-style/2014Dec/0312.html
>
> The conclusion I got but that time was that even if grid items have
> "stretch" by default, they're rendered as inline-blocks so they do not
> shrink to fit. Maybe I'm missing something.

That thread is only about painting order...

Grid items are allowed to shrink on 'stretch' because that's the behavior
defined for stretched flex items, and we wanted them consistent.

(Otherwise, I'd have preferred if align-self: stretch; and align-content: stretch behaved the same way.)

~fantasai

Received on Friday, 4 December 2015 00:09:29 UTC