Re: [csswg-drafts] [css-grid-1] Spec doesn't seem to discuss baseline-alignment + auto-margins. (#5923)

@bfgeek

You're right that this was unspecified - quite a bit of margin interactions were, as we found out while digging into this! We committed the following fixes:

* Made the definition of auto margins for grid items normative, and tightened it up in https://github.com/w3c/csswg-drafts/commit/16ed028af7c0d0a59a6b723ac15f5c817bcd6353.
* Defined that overflowing items with auto margins safe-align, just as they do in Flexbox, in https://github.com/w3c/csswg-drafts/commit/7b78f0dd7648fc258be1ecdb20ebdf9b6be089e1.
* Defined more completely how baseline self-alignment and content alignment work in https://github.com/w3c/csswg-drafts/commit/965a5af1e8fb03f3706592e416bb7a01169c665b  (filed separately as https://github.com/w3c/csswg-drafts/issues/6389).
* Committed a proposed fix for this issue in https://github.com/w3c/csswg-drafts/commit/c78e58b5ccd893de6811d7b083f57809c102a102).

That final proposed fix (https://github.com/w3c/csswg-drafts/commit/c78e58b5ccd893de6811d7b083f57809c102a102) specifies that auto margins only disable baseline content-alignment if they conflict with its baseline preference, identically to how self-alignment was already specified to work. (I.e. start-aligning a box, whether with margins or alignment properties, is compatible with first-baseline alignment; and end-aligning the box is compatible with last-baseline alignment.)

This doesn't quite match current implementations, but we think it makes the most sense, since auto margins and self-alignment are, in practice, identical for authors. However, we're okay with just fully disabling baseline content-alignment in the presence of auto margins if necessary. What do people think? (Agenda+ to ask more broadly.)

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 16 June 2021 22:21:20 UTC