Skip to content

Commit 5a98e20

Browse files
committed
[css-grid-2] Remove dual-axis subgrid proposal in favor of per-axis subgrids. Closes #2280.
1 parent bb80483 commit 5a98e20

1 file changed

Lines changed: 24 additions & 79 deletions

File tree

css-grid-2/Overview.bs

Lines changed: 24 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,8 @@ Introduction {#intro}
1616
=====================
1717

1818
This level is currently maintained as a diff spec over the level 1 module [[!CSS-GRID-1]].
19-
The main addition to Level 1 is the “subgrid” feature,
20-
which has two proposals:
21-
22-
<ul>
23-
<li>
24-
<a href="#subgrid-per-axis">Per-axis Subgrids</a>,
25-
which use a ''grid-template-columns/subgrid'' keyword on the 'grid-template' properties
26-
to mark one or both axes as subgridded.
27-
This proposal is strictly more powerful.
28-
<li>
29-
<a href="#subgrid-dual-axis">Dual-axis Subgrids</a>,
30-
whic use a ''grid-template-columns/subgrid'' keyword on the 'display' property
31-
to mark both axes as subgridded.
32-
This proposal is strictly more limited.
33-
</ul>
34-
35-
A subgridded axis is one which matches up its grid lines
19+
The main addition to Level 1 is the “subgrid” feature:
20+
a subgridded axis is one which matches up its grid lines
3621
to lines in the element's parent's grid,
3722
and which derives the sizes of its tracks
3823
through this integration with the parent grid.
@@ -86,9 +71,8 @@ Subgrids</h2>
8671
}
8772
li {
8873
grid-column: span 2;
89-
<del>display: subgrid;</del>
90-
<ins>display: grid;
91-
grid: subgrid;</ins>
74+
display: grid;
75+
grid: subgrid;
9276
border: solid;
9377
}
9478
label {
@@ -99,32 +83,6 @@ Subgrids</h2>
9983
}
10084
</pre>
10185
</div>
102-
<h3 id="subgrid-dual-axis">
103-
Establishing a Subgrid: Dual-axis Proposal</h3>
104-
105-
<a>Subgrids</a> provide the ability to pass grid parameters down through nested elements,
106-
and content-based sizing information back up to their parent grid.
107-
108-
<pre class="propdef">
109-
Name: display
110-
New values: subgrid
111-
</pre>
112-
113-
<dl dfn-for="display" dfn-type=value>
114-
<dt><dfn>subgrid</dfn>
115-
<dd>
116-
If the element is a <a>grid item</a>
117-
(i.e. it is in-flow and its parent is a <a>grid container</a>),
118-
this value makes the element a <a>subgrid</a>
119-
(which is a special type of <a>grid container</a> box, see [[#subgrids]])
120-
and consequently ignores its 'grid-template-*' and '*-gap' properties
121-
in favor of adopting the parent grid tracks that it spans.
122-
123-
Otherwise,
124-
it behaves as ''grid''.
125-
</dl>
126-
127-
Issue: This syntax only allows for subgrids which are subgridded in both axes.
12886

12987
<h3 id="subgrid-per-axis">
13088
Establishing a Subgrid: Per-Axis Proposal</h3>
@@ -146,18 +104,16 @@ Establishing a Subgrid: Per-Axis Proposal</h3>
146104
the initial value, ''grid-template-rows/none''.
147105
</dl>
148106

149-
Issue: This syntax allows for subgrids which are subgridded in one <em>or</em> both axes.
107+
Issue: Add back syntax for overlaying line names.
150108

151109
<h3 id="subgrid-items">
152110
Characteristics of a Subgrid Item</h3>
153111

154-
Note: <ins>Insertions</ins> are differences between the dual-axis and per-axis proposals.
155-
156112
A <a>subgrid</a> behaves just like a normal <a>grid container</a> except that:
157113

158114
<ul style="list-style-type: lower-alpha">
159115
<li>
160-
The number of explicit tracks in each <ins>subgridded</ins> dimension
116+
The number of explicit tracks in each subgridded dimension
161117
is given by its <a>grid span</a> in that dimension,
162118
rather than by 'grid-template-rows'/'grid-template-columns'.
163119

@@ -169,17 +125,17 @@ Characteristics of a Subgrid Item</h3>
169125

170126
<li>
171127
Since <a>subgrids</a> can be placed before their contents are placed,
172-
<del>their</del> <ins>the subgridded</ins> lines
128+
the subgridded lines
173129
automatically receive the line names specified on the parent <a>grid</a>.
174130

175131
<li>
176132
The <a>subgrid</a> itself lays out as an ordinary <a>grid item</a> in its parent grid,
177133
but acts as if it was completely empty for sizing purposes
178-
<ins>in the subgridded dimension</ins>.
134+
in the subgridded dimension.
179135

180136
The <a>subgrid</a>'s own <a>grid items</a> participate
181-
in the sizing of its parent grid <ins>in the subgridded dimension(s)</ins>
182-
and are aligned to it <ins>in those dimensions</ins>.
137+
in the sizing of its parent grid in the subgridded dimension(s)
138+
and are aligned to it in those dimensions.
183139
In this process, the sum of the <a>subgrid</a>'s margin, padding, and borders at each edge
184140
are applied as an extra layer of margin to the items at those edges.
185141

@@ -212,14 +168,14 @@ Characteristics of a Subgrid Item</h3>
212168
</div>
213169

214170
<li>
215-
The 'gap' properties do not apply <del>to subgrids</del>
216-
<ins>in the subgridded dimension(s)</ins>.
171+
The 'gap' properties do not apply
172+
in the subgridded dimension(s).
217173
(Their items are instead spaced by the corresponding gutters of their parent grid,
218174
since they are laid out in the parent grid.)
219175

220176
<li>
221177
The <a>subgrid</a> does not have any <a>implicit grid tracks</a>
222-
<ins>in the subgridded dimension(s)</ins>;
178+
in the subgridded dimension(s);
223179
every <a>grid area</a> within it is <a>clamped</a> to its <a>explicit grid</a>.
224180

225181
<div class="example">
@@ -228,15 +184,15 @@ Characteristics of a Subgrid Item</h3>
228184
</div>
229185

230186
<li>
231-
The <a>subgrid</a> is always stretched <del>in both dimensions</del> <ins>in its subgridded dimension(s)</ins>:
187+
The <a>subgrid</a> is always stretched in its subgridded dimension(s:
232188
the 'align-self'/'justify-self' properties on it are ignored,
233189
as are any specified width/height constraints.
234190

235191
<li>
236192
Layoutwise, the <a>subgrid</a>’s <a>grid</a>
237193
is always aligned with the corresponding section of the parent <a>grid</a>;
238194
the 'align-content'/'justify-content' properties on it are also ignored
239-
<ins>in the subgridded dimension</ins>.
195+
in the subgridded dimension.
240196

241197
<li>
242198
The UA <em>may</em> apply 'overflow' to <a>subgrids</a>
@@ -252,10 +208,6 @@ Subgrid Sizing Algorithm</h3>
252208
including subgrids and their sub-items,
253209
occurs before sizing.
254210

255-
Issue: In this section, which is itself a diff,
256-
<i>italics</i> indicate additional prose
257-
specific to <a href="#subgrid-per-axis">per-axis subgrids</a>.
258-
259211
Track sizing in a subgridded dimension
260212
treats each item in a given track in that axis
261213
as members of the parent grid.
@@ -271,17 +223,15 @@ Subgrid Sizing Algorithm</h3>
271223
<li>
272224
First, the <a>track sizing algorithm</a> is used to resolve the sizes of the <a>grid columns</a>.
273225

274-
<ins>
275-
276-
<p>In this process,
226+
In this process,
277227
any <a>grid item</a> which is subgridded
278228
in the <a>grid container</a>’s <a>inline axis</a>
279229
is treated as empty
280230
and its <a>grid items</a> (the grandchildren)
281231
are treated as direct children of the <a>grid container</a> (their grandparent).
282232
This introspection is recursive.
283233

284-
<p><i>Items which are subgridded only in the <a>block axis</a>,
234+
Items which are subgridded only in the <a>block axis</a>,
285235
and whose <a>grid container</a> size in the <a>inline axis</a>
286236
depends on the size of its contents
287237
are also introspected:
@@ -298,9 +248,7 @@ Subgrid Sizing Algorithm</h3>
298248
the item will have completed a first pass through steps 1-3
299249
as well as the second pass of this step
300250
prior to returning its size for consideration in this grid’s column sizing.
301-
Again, this introspection is recursive.</i></p>
302-
303-
</ins>
251+
Again, this introspection is recursive.
304252

305253
If calculating the layout of a <a>grid item</a> in this step
306254
depends on the <a>available space</a> in the <a>block axis</a>,
@@ -312,17 +260,15 @@ Subgrid Sizing Algorithm</h3>
312260
Next, the <a>track sizing algorithm</a> resolves the sizes of the <a>grid rows</a>,
313261
using the <a>grid column</a> sizes calculated in the previous step.
314262

315-
<ins>
316-
317-
<p>In this process,
263+
In this process,
318264
any <a>grid item</a> which is subgridded
319265
in the <a>grid container</a>’s <a>block axis</a>
320266
is treated as empty
321267
and its <a>grid items</a> (the grandchildren)
322268
are treated as direct children of the <a>grid container</a> (their grandparent).
323269
This introspection is recursive.
324270

325-
<p><i>As with sizing columns,
271+
As with sizing columns,
326272
items which are subgridded only in the <a>inline axis</a>,
327273
and whose <a>grid container</a> size in the <a>block axis</a>
328274
depends on the size of its contents
@@ -332,8 +278,7 @@ Subgrid Sizing Algorithm</h3>
332278
is taken under the provision
333279
of having determined its track sizing
334280
only up to this corresponding point in the algorithm;
335-
and again, this introspection is recursive.)</i></p>
336-
</ins>
281+
and again, this introspection is recursive.)
337282

338283
<li>
339284
Then, if the <a>min-content contribution</a> of any grid items have changed
@@ -377,10 +322,10 @@ Subgrid Sizing Algorithm</h3>
377322
We could simplify this by saying that an orthogonal flow
378323
cannot establish a subgrid; it can only be a nested grid.
379324

380-
<i>The following example illustrates how per-axis subgrids are sized:</i>
325+
<div class="example">
326+
The following example illustrates how per-axis subgrids are sized:
381327

382-
<div class="example" style="font-style: italic">
383-
For example, suppose we have a parent grid container <var>A</var>
328+
Suppose we have a parent grid container <var>A</var>
384329
which contains an item <var>B</var> that has subgridded columns
385330
and contains a grandchild <var>B</var> that has subgridded rows
386331
and grandchild <var>D</var> that is simply a nested grid.

0 commit comments

Comments
 (0)