Re: [csswg-drafts] [css-align] `justify-items` and anonymous block boxes (#11461)

The CSS Working Group just discussed ``[css-align] `justify-items` and anonymous block boxes``, and agreed to the following:

* `RESOLVED: Anonymous block boxes always stretch (go with option 1)`

<details><summary>The full IRC log of that discussion</summary>
&lt;oriol> https://github.com/w3c/csswg-drafts/issues/11461#issuecomment-2842434810<br>
&lt;emilio> oriol: since we resolve justify-self can force fit-content size, if you use justify-items on a block container, a block container with inline level contents, justify-items won't apply<br>
&lt;emilio> ... if you then add a block, you add an anonymous block level box and justify-self applies to it<br>
&lt;emilio> ... so it's very unexpected that adding a block-level sibling changes the alignment<br>
&lt;emilio> ... option 1 would be that anon block boxes would always stretch rather than using justify-items of the parent<br>
&lt;emilio> ... another option would be that justify-items other than initial you'd still wrap stuff<br>
&lt;emilio> ... IMO option 1 is the easiest to implement in servo, also avoids some questions about what to do with percentages and so on<br>
&lt;iank_> +1 Oriol - There is a whole can of worms involved w/ option (2)<br>
&lt;emilio> ... percentages in the block axis skips anon boxes, should we skip them in the inline axis if we consider the other option?<br>
&lt;emilio> ... miriam preferred option 2 since it's more useful for authors (no need to wrap in implicit elements)<br>
&lt;astearns> ack miriam<br>
&lt;iank_> q+<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> miriam: oriol described what I think, alignment is one of the more common things to do and doing it easily makes sense<br>
&lt;fantasai> https://www.w3.org/TR/css-text-4/#text-group-align-property<br>
&lt;emilio> .. but either option feels better than the alternative<br>
&lt;emilio> fantasai: there's one property that allows you to wrap things, not sure it's implemented<br>
&lt;emilio> ... the behavior you want is not the behavior that would fall off from wrapping in anon boxes<br>
&lt;emilio> ... consider a paragraph with text, block level, then text<br>
&lt;emilio> ... if we wrap each in a box then they'd be independently aligned which I'm not sure is what you want<br>
&lt;astearns> ack iank_<br>
&lt;emilio> iank_: pretty against option 2<br>
&lt;emilio> ... quite a large can of worms<br>
&lt;emilio> ... probably big source of confusion for web devs too<br>
&lt;emilio> ... a little concerned about compat too<br>
&lt;emilio> ... so prefer option 1, authors ??? text-align<br>
&lt;emilio> astearns: we could resolve on updating the spec to option 1 with a note<br>
&lt;emilio> miriam: ok with that<br>
&lt;emilio> PROPOSED: Anonymous block boxes always stretch<br>
&lt;emilio> RESOLVED: Anonymous block boxes always stretch (go with option 1)<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11461#issuecomment-2880941020 using your GitHub account


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

Received on Wednesday, 14 May 2025 17:02:40 UTC