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

> How is the anonymous box in option 2 sized?

Yes, both the current Blink behavior and option 2 raise some questions about that. So from an implementation point of view I prefer option 1, which is what I implemented in Servo (I didn't have to do anything special, I just got this behavior due to how we implement anonymous block boxes).

Presumably the anonymous box would be sized as `fit-content` instead of `stretch`. But percentages in the block axis skip anonymous block boxes, should it be the same in the inline axis? And what about `stretch`?

```html
<!DOCTYPE html>
<style>
div { float: left; width: 100px; height: 100px;justify-items: right; border: solid; margin: 1em }
div::before { content: ""; display: block }
span { display: inline-block; border: solid magenta }
</style>
<div> <span style="width: 100%; height: 100%"></span> </div>
<div> <span style="width: stretch; height: stretch"></span> </div>
```

![](https://github.com/user-attachments/assets/b7cfc842-3fae-4225-b1c2-3bd55b3f78da)

So Blink breaks the axis symmetry by allowing percentages and `stretch` to resolve against anonymous block boxes in the inline axis. This inconsistency doesn't sound great, so it solidifies option 1 as the best option for me.

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


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

Received on Wednesday, 30 April 2025 19:18:42 UTC