-
Notifications
You must be signed in to change notification settings - Fork 715
[css-align][css-grid][css-flex] Baseline alignment not implemented due to lack of specs #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
No, I'm pretty sure Grid already handles this fine. Over in Align, baseline alignment is defined as:
(or padding, for content alignment) And then Grid just operates on min/max-content contributions, which include the margins of the element.
|
Wait, never mind, Align already says that:
|
Baseline content-alignment only works between things in "row-like contexts" https://drafts.csswg.org/css-align/#baseline-align-content - table cells, flex items, and grid items. Inline-level boxes (such as an inline-grid container) are not on that list, so they don't participate in baseline content-alignment. (We can clarify the spec a bit here.) So you can content-align the grid items in the container with each other (they'll get magic-padding to make their baselines align), but the grid container itself can't be baseline content-aligned in this context. (Only thing you can do is use |
Are there contexts in which you should be able to baseline-align a grid container? If the grid is inside a flexbox, for instance, how would align-content work in this case? Adding a padding-top to the grid? |
Yes, exactly. (Well, conceptually. The computed/used value of padding-top does not change.) |
92cbf50 clarifies that boxes not in a shared alignment context do not baseline-align; they use the fallback alignment (start/end depending on first/last baseline). Let me know if you need any further clarifications. |
Thanks, I think things are clear again; let's close for now and I'll reopen if we can come up with another question. |
Flexbox does have some text talking about baseline support, indeed:
http://www.w3.org/TR/css-flexbox-1/#cross-sizing
However, it seems the Microsoft implementation of grids didn't have a similar baseline-align value and, correct me if I'm wrong, the current Blink implementation doesn't support the value either. Supporting the value would, as far as I understand, require significant changes to the track-sizing algorithms to keep track on these above/below the baseline measurements, like we do in css-tables.
I am therefore not sure the baseline section that was added to the spec "compiles" right now:
https://drafts.csswg.org/css-grid/#grid-baselines
I think the topic should be brought to discussion in the working group. We should either clarify that grid does not support baseline-alignment (ignores the value) or that it does, and reflect that in the algorithms. I am not sure this is something our team is willing to put in the Level 1 version of the spec, though. I personally never understood why you would want to baseline-align things in a table, but I guess some people use it for some reason.
The text was updated successfully, but these errors were encountered: