Re: [csswg-drafts] [css-align][css-grid] Baseline self-alignment may affect the intrinsic size contribution of the alignment subject.

1- How we should resolve the items with relative size (percentages) ? Should their size be resolved using the new content-sized track's size ?

No. Grid doesn't have any special exceptions for making additional things definite, so %s resolve as normal: if the grid area is definite, they resolve accordingly; if not, they don't.  See https://www.w3.org/TR/CSS21/visudet.html#the-height-property . This is completely unconnected from alignment.

2- Content Alignment affects the final size of the grid area when items spans more than one track. The space distributed depends on the one available after completing the track sizing algorithm. For items with a relative size, we only know their actual size after applying the content alignment rules. However, if baseline alters the size of the tracks, how this would affect to the item's relative size ?

I'm not sure I understand the confusion, but let's walk through an example. Let's say we have a 4-column grid, where the item in the last column spans three rows, and the first row has first-baseline alignment on all items.

First we size all the items in the row normally. Then we align them together. For this purpose, we consider the spanning item. This may cause some of the items to get shifted down more, as if they had more margin/padding on the top.

Then we size the rows: in the first step we consider only nonspanning items, so we size the first row accordingly. This will include the alignment “margin/padding" that we calculated for these items. Then we adjust the rows to accommodate the spanning items if necessary.

That's it. We don't need to consider percentage sizes, because they don't resolve against auto-height rows.

~fantasai and TJ

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1039#issuecomment-298786382 using your GitHub account

Received on Tuesday, 2 May 2017 23:10:04 UTC