Repository navigation
[css-align] align-content: baseline is busted #13421
Copy link
Copy link
Closed
Labels
Description
I've been meaning to file this issue for a while, but finally got around to creating a testcase:
Code
<!DOCTYPE html>
<style>
.container {
margin: 10px;
gap: 5px;
border: solid 3px;
height: 100px;
width: max-content;
}
.container :is(div, td):nth-child(1) {
font-size: 40px;
align-self: baseline;
background: lime;
&::before {
content: 'large text';
}
}
.container :is(div, td):nth-child(2) {
font-size: 12px;
align-content: baseline;
background: cyan;
&::before {
content: 'small text';
}
}
.container :is(div, td):nth-child(3) {
display: flex;
font-size: 12px;
align-content: baseline;
background: orange;
&::before {
content: 'small text';
}
}
.container :is(div, td):nth-child(4) {
display: grid;
font-size: 12px;
align-content: baseline;
background: cornflowerblue;
&::before {
content: 'small text';
}
}
td {
vertical-align: middle;
}
</style>
<div class="container" style="display: flex;">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="container" style="display: grid; grid-auto-flow: column;">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<table class="container">
<td style="align-content: baseline;"></td>
<td></td>
</table>
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=14481
- Parsing
align-content: baseline/align-content: last baseline- Blink/Gecko/WebKit parses
align-content: baseline - Gecko/WebKit parse
align-content: last baseline(Blink explicitly didn't ship this as we knew is was broken, but WebKit appears to have shipped sometime in ~2022 https://webkit.org/blog/13591/webkit-features-in-safari-16-2/#:~:text=align%2Dcontent%3A%20last%20baseline ).
- Blink/Gecko/WebKit parses
- Fallback alignment (no baseline alignment context)
- Gecko/WebKit only support the fallback alignment for
last baselineif the container isdisplay: block(from my testing).
- Gecko/WebKit only support the fallback alignment for
- Baseline alignment (testcase above, another item providing a baseline-context).
- Blink/WebKit - not supported in
grid/flexbox, supported intable. - Gecko - not supported in
flexbox/table, very broken support ingrid(there is hysterisis, and for the life of my cannot work out what Gecko is doing).
- Blink/WebKit - not supported in
So options.
- We do nothing. IMO this risks anyone actually trying to ship this feature properly. E.g. sites may have
align-content: last baselinespecified on things assuming it'll do nothing. - Everyone unships
align-content: baseline/align-content: last baseline. Likely won't break anything due to the poor compat we have already, and movealign-content: baselineto a later spec or similar or mark at-risk. - We specify that these features are broken, and just fallback to
start/endalignment.
IMO this isn't a highly requested feature from web-developers (e.g. we haven't seen requests in our bug tracker to fix align-content: baseline), but at the moment the status quo is particularly bad.
Reactions are currently unavailable
Activity
fantasai commentedon Jun 2, 2026
Since it's not working on anything except tables (which historically use
vertical-alignanyway) I think unshipping the parsing support makes the most sense.emilio commentedon Jun 2, 2026
I'm ok with trying to unship it given the above...
@dholbert, do you have some context on what our grid code is doing? If it's useful I could try to dig...
dholbert commentedon Jun 2, 2026
I'm ok too. It was never fully complete, so it doesn't surprise me that there's weirdness. Probably not worth spending time debugging it at this point if there's consensus on unshipping.
dholbert commentedon Jun 3, 2026
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=2044513 to put it behind an about:config pref, at the parser level.
astearns commentedon Jun 3, 2026
Hand-edited minutes
RESOLVED: Unship align-content: baseline/last baseline for now
RESOLVED: Add a note to the spec so people don't get tripped-up
Details
[css-align-3] Add note about partial implementations #13421