Re: [css-align][css-grid] Stretching grid tracks in Content Distribution alignment

On Mon, Jun 8, 2015 at 12:23 AM, Javier Fernandez <jfernandez@igalia.com> wrote:
> Hi all,
>
> I've got some doubts about how to interpreter 'stretch' definition in
> the context of Content Distribution alignment and Grid Layout.
>
> http://dev.w3.org/csswg/css-align/#valdef-content-distribution-stretch
> "If the combined size of the alignment subjects is less than the size of
> the alignment container, any auto-sized alignment subjects have their
> size increased equally (not proportionally), while still respecting the
> constraints imposed by max-height/max-width, so that the combined size
> exactly fills the alignment container."
>
> According to the specs, Grid Layout considers grid tracks as the
> alignment subjects for Content Distribution alignment, so the issues I'd
> like to clarify are:
>
> 1- What actually means an 'auto-sized' grid tack ?
> 2- How to impose max-height/max-width constrains to grid track sizing ?
>
> For the first question, it's obvious that tracks with size 'auto' are
> clearly candidates for stretching. Last draft version of the Grid Layout
> spec defines 'auto' size s follows:
>
> http://dev.w3.org/csswg/css-grid/#valdef-grid-template-columns-auto
> "As a maximum, identical to max-content. As a minimum, represents the
> largest minimum size (as specified by min-width/min-height) of the grid
> items occupying the grid track."
>
> In my initial implementation I considered any 'content-sized' track as
> 'auto-sized', hence candidate to be stretched if alignment style rules
> dictate it. But after some discussion with my colleges, I'm not totally
> sure tracks sized as, for instance, max-content should be stretched. At
> least, I didn't follow that approach for grid items, which only the ones
> with height/width 'auto' can be stretched.

Your assumptions at the end (that you should match grid items) are
correct.  We'll specify that only "auto" max sizing functions get
stretched.

> The second question is related to the lack of a min-width/height,
> max-width/height properties specific for grid tracks. I guess
> minmax(min, max) could be something similar, but since 'auto' is defined
> as well using minmax, and considering that stretch will obviously grow
> track sizes over those limits I'm not sure how the "respecting the
> constraints imposed by max-height/max-width" restriction could apply to
> this scenario.

"auto" isn't defined as minmax() anymore; it's its own independent
value (and can even be used *in* minmax, as the fr value says).

Since tracks aren't elements, they don't have those properties, and so
there's no constraints to apply.  (The min track sizing function is
handled manually in the track sizing algorithm.)

~TJ

Received on Thursday, 16 July 2015 23:38:13 UTC