- From: Ian Kilpatrick via GitHub <sysbot+gh@w3.org>
- Date: Wed, 10 May 2023 00:02:09 +0000
- To: public-css-archive@w3.org
So grid is in a super strange place at the moment. I was initially agnostic about which was this should go - but now I suspect we want to go with @tabatkins position. Lets say you have: ```html <!DOCTYPE html> <style> .grid { display: inline-grid; border: solid 5px; padding: 10px; } .oof { position: absolute; width: 15px; height: 15px; background: lime; } </style> <div class="grid" style="position: static;"> <div class="oof"></div> </div> <div class="grid" style="position: relative;"> <div class="oof"></div> </div> <div class="grid" style="position: relative;"> <div class="oof" style="grid-row: 1; grid-column: 1;"></div> </div> ``` With grid (1) we'll use the resolution in https://github.com/w3c/csswg-drafts/issues/3020#issuecomment-415086888 and use the content-box, as the containing-block isn't the grid. https://drafts.csswg.org/css-grid-1/#static-position > "The [static position](https://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-width) [[CSS2]](https://drafts.csswg.org/css-grid-1/#biblio-css2) of an absolutely-positioned child of a [grid container](https://drafts.csswg.org/css-grid-1/#grid-container) is determined as if it were the sole grid item in a [grid area](https://drafts.csswg.org/css-grid-1/#grid-area) whose edges coincide with the content edges of the grid container." With grid (2) as the grid *is* the containing-block we'll use the padding-box for the static-position (this strikes me as incorrect). As we invoke: > However, if the grid container parent is also the generator of the absolutely positioned element’s [containing block](https://drafts.csswg.org/css-display-4/#containing-block), instead use the grid area determined in [§ 9.1 With a Grid Container as Containing Block](https://drafts.csswg.org/css-grid-1/#abspos-items). And grid (3) we invoke the above logic, but use are actually placed in a useful area. For grid (2) re-using the contianing-block logic is super strange? -- GitHub Notification of comment by bfgeek Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7661#issuecomment-1541037807 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 10 May 2023 00:02:11 UTC