- From: Ian Kilpatrick via GitHub <noreply@w3.org>
- Date: Mon, 06 Apr 2026 19:59:33 +0000
- To: public-css-archive@w3.org
bfgeek has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-flexbox-1] visibility:collapse causes shifts if items are baseline-aligned. ==
https://drafts.csswg.org/css-flexbox-1/#visibility-collapse
https://drafts.csswg.org/css-flexbox-1/#algo-visibility
Today the algorithm only records a "strut size" (presumably) to prevent items from shifting in the cross-axis when an item toggles `visibility: collapse`. This isn't enough to prevent shifts, it also needs to record the baseline of the item as well.
See in Firefox:
```
<!DOCTYPE html>
<style>
div > div {
min-width: 20px;
}
</style>
<div style="display: flex; gap: 5px; align-items: baseline; flex-wrap: wrap; width: 100px; border: solid 3px;">
<div style="background: lime;">1</div>
<div style="background: hotpink; align-self: end;">2</div>
<div id="target" style="background: orange; font-size: 30px; visibility: collapse">3</div>
</div>
```
(and toggle the collapsed item).
Likely should be updated to record the baseline as well for this purpose.
cc/ @tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13771 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 6 April 2026 19:59:34 UTC