Re: [csswg-drafts] [css-grid-3][masonry] impact of negative margins on running positions within a track, dense-packing, and alignment (#12918)

When dense-packing is enabled and we place a multi-span item and it creates a track opening, should the track opening reflect where the item is actually placed, or where the item would have been placed without negative margins?

In this example (1) here: 

<img width="1093" height="723" alt="Image" src="https://github.com/user-attachments/assets/6dda3a9c-0162-497a-ba1f-3ed542bdb372" />

Should the track opening be 15px or 40px?

And in this example (2): 

<img width="797" height="667" alt="Image" src="https://github.com/user-attachments/assets/f0cba274-18d6-4087-9771-8be3f117b0ae" />

Is a new track opening created?  Or, in parity with single-spanning items, does the existing track opening remain unaffected?

If we want to be consistent with the currently resolved single-spanning dense-packing behavior, it would make sense for example 1 to have the track opening only be created where the item is actually placed, while in example 2, the existing track opening is not affected.

The reasoning being that in our current resolved behavior for negative margins in dense-packing, any items placed into "previous" track opening touched by an item with negative margins would cover that item like so:

<img width="1452" height="597" alt="Image" src="https://github.com/user-attachments/assets/bd79fbcb-669e-448d-a1e6-5c4c68f9556d" />

And so in example 2, it makes sense that items placed afterwards would cover it: 

<img width="757" height="566" alt="Image" src="https://github.com/user-attachments/assets/3732d7e5-135f-4e04-8856-e537cdb8ce9d" />

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


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

Received on Wednesday, 19 November 2025 17:49:24 UTC