Skip to content

Commit fd4cc6c

Browse files
committed
[css-grid-2] Define subgrids with an automatic span to take their span from the number of explicit tracks. #2565
1 parent 76098be commit fd4cc6c

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

css-grid-2/Overview.bs

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,36 @@ Characteristics of a Subgrid Item</h3>
147147

148148
<ul style="list-style-type: lower-alpha">
149149
<li id="subgrid-tracks">
150-
The number of explicit tracks in each subgridded dimension
151-
is given by its <a>grid span</a> in that dimension,
152-
rather than by 'grid-template-rows'/'grid-template-columns'.
153-
The track sizes are governed by the parent grid.
154-
150+
Placing the <a>subgrid</a>
151+
creates a correspondence between its subgridded tracks
152+
and those that it spans in its parent grid.
155153
The grid lines thus shared between the subgrid and its parent
156-
form the subgrid’s <a>explicit grid</a>.
154+
form the subgrid’s <a>explicit grid</a>,
155+
and its track sizes are governed by the parent grid.
156+
157+
<li id="subgrid-span">
158+
The number of explicit tracks in the <a>subgrid</a>
159+
in a subgridded dimension
160+
always corresponds to the number of <a>grid tracks</a>
161+
that it spans in its parent <a>grid</a>:
162+
163+
<ul>
164+
<li>
165+
If the <a>subgrid</a>’s <a>grid span</a> in the subgridded dimension is definite,
166+
then the number of explicit tracks in each subgridded dimension
167+
is taken from its used <a>grid span</a> in that dimension
168+
(regardless of its 'grid-template-*' properties).
169+
170+
<li>
171+
If it has an <a>indefinite grid span</a>
172+
(i.e. either the '-start' or '-end' value
173+
of its <a>grid-placement properties</a> in the subgridded axis
174+
is ''grid-row-start/auto'')
175+
then its used <a>grid span</a> is taken
176+
from the number of explicit tracks specified for that axis
177+
by its 'grid-template-*' properties,
178+
floored at one.
179+
</ul>
157180

158181
<li id="subgrid-indexing">
159182
The <a>grid-placement properties</a> of the <a>subgrid</a>’s <a>grid items</a>

0 commit comments

Comments
 (0)