Skip to content

Commit 7b738cf

Browse files
committed
[css3-grid-layout] Draft ideas for abspos grid children.
1 parent f2e07af commit 7b738cf

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

css3-grid-layout/Overview.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,50 @@ <h3 id=non-children-grid-items><span class=secno>4.1. </span>Non-children
11401140
<h3 id=absolutely-positioned-grid-children><span class=secno>4.2.
11411141
</span>Absolutely Positioned Grid Children</h3>
11421142

1143+
<p> An absolutely-positioned child element of a <a
1144+
href="#grid-container"><i>grid container</i></a> does not participate
1145+
directly in grid layout. Its static position is ???
1146+
1147+
<div class=issue>
1148+
<ul>
1149+
<li>The before/start corner of the grid container? (In this case, should
1150+
we adjust Flexbox to match?)
1151+
1152+
<li>The before/start edge of the cell it would be placed in, if it were a
1153+
1x1 auto-placed grid item? (Don't let it generate new rows/columns,
1154+
though, which complicates things.) (This is closer to Flexbox's current
1155+
behavior.)
1156+
</ul>
1157+
</div>
1158+
1159+
<p class=issue> Below is a proposal for how to deal with abspos in grid
1160+
containers. It gives us many of the capabilities of [[CSS3-GRID]].
1161+
1162+
<p> If an absolutely positioned element's <i>containing block</i> is
1163+
generated by a <a href="#grid-container"><i>grid container</i></a>, the <a
1164+
href="#grid-placement-properties"><i>grid-placement properties</i></a> can
1165+
be used to constrain it to a particular <a href="#grid-area"><i>grid
1166+
area</i></a>, similar to how they affect regular <a
1167+
href="#grid-item"><i>grid items</i></a>. In this case, an ‘<a
1168+
href="#track-size-auto"><code class=css>auto</code></a>’ value for a <a
1169+
href="#grid-placement-properties"><i>grid-placement property</i></a>
1170+
indicates ...
1171+
1172+
<div class=issue>
1173+
<ul>
1174+
<li>the padding edge of the <a href="#grid-container"><i>grid
1175+
container</i></a> (as normal for abspos)
1176+
1177+
<li>the next/previous grid line (as normal for grid items with one ‘<a
1178+
href="#track-size-auto"><code class=css>auto</code></a>’ value in a
1179+
dimension, as it resolves to ‘<code class=css>span 1</code>’)
1180+
</ul>
1181+
</div>
1182+
1183+
<p class=note> This can allow an abspos to "skip past" intervening grid
1184+
containers, and resolve its grid-placement properties against a grid
1185+
container other than its closest ancestor.
1186+
11431187
<h3 id=collapsed-grid-items><span class=secno>4.3. </span>Collapsed Grid
11441188
Items</h3>
11451189

css3-grid-layout/Overview.src.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,43 @@ <h3>Non-children Grid Items</h3>
807807

808808
<h3>Absolutely Positioned Grid Children</h3>
809809

810+
<p>
811+
An absolutely-positioned child element of a <i>grid container</i> does not participate directly in grid layout.
812+
Its static position is ???
813+
814+
<div class='issue'>
815+
<ul>
816+
<li>The before/start corner of the grid container?
817+
(In this case, should we adjust Flexbox to match?)
818+
<li>The before/start edge of the cell it would be placed in, if it were a 1x1 auto-placed grid item?
819+
(Don't let it generate new rows/columns, though, which complicates things.)
820+
(This is closer to Flexbox's current behavior.)
821+
</ul>
822+
</div>
823+
824+
<p class='issue'>
825+
Below is a proposal for how to deal with abspos in grid containers.
826+
It gives us many of the capabilities of [[CSS3-GRID]].
827+
828+
<p>
829+
If an absolutely positioned element's <i>containing block</i>
830+
is generated by a <i>grid container</i>,
831+
the <i>grid-placement properties</i> can be used to constrain it to a particular <i>grid area</i>,
832+
similar to how they affect regular <i>grid items</i>.
833+
In this case, an ''auto'' value for a <i>grid-placement property</i> indicates ...
834+
835+
<div class="issue">
836+
<ul>
837+
<li>the padding edge of the <i>grid container</i> (as normal for abspos)
838+
<li>the next/previous grid line (as normal for grid items with one ''auto'' value in a dimension, as it resolves to 'span 1')
839+
</ul>
840+
</div>
841+
842+
<p class='note'>
843+
This can allow an abspos to "skip past" intervening grid containers,
844+
and resolve its grid-placement properties against a grid container
845+
other than its closest ancestor.
846+
810847
<h3>Collapsed Grid Items</h3>
811848

812849
<p class='issue'>

0 commit comments

Comments
 (0)